Submit your widget

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

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