Submit your widget

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

Created 11 years ago   Views 8283   downloads 1152    Author apopelo
jQuery Hashchange - A jQuery plugin to custom url hash (uri fragment id) values
View DemoDownload
16
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