Submit your widget

jQuery Hashchange - A jQuery plugin to custom url hash (uri fragment id) values

Created 6 years ago   Views 21740   downloads 1886    Author apopelo
jQuery Hashchange - A jQuery plugin to custom url hash (uri fragment id) values
View DemoDownload
78
Share |

jQuery Hashchange - A jQuery plugin to custom url hash (uri fragment id) values.

Example:

/*

Code below means:

    1. Call onSet() callback each time when url changes to
       http://.../#!/login/

    2. Call onRemove() callback each time when url changes from
       http://.../#!/login/ to anything else, e.g.
       http://.../#!/ or http://.../

*/
$(window).hashchange({
    hash: "#!/login/",
    onSet: function() {
        $("#login-form").show();
    },
    onRemove: function() {
        $("#login-form").hide();
    },
});

 

Tag: url hash