Submit your widget

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

Created 10 years ago   Views 7561   downloads 972    Author apopelo
jQuery Hashchange - A jQuery plugin to custom url hash (uri fragment id) values
View DemoDownload
14
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