0
當我使用hashchange jQuery插件從http://benalman.com/projects/jquery-hashchange-plugin/掛鉤的事件時,窗口的location.hash變化獲取當前哈希值。Hashchange jQuery插件 - 點擊錨
我想在散列更改時通過新散列值(使用event.fragment
獲得)和當前散列值(即將觸發事件之前的值)來觸發函數。
這裏是想什麼,我實現了文檔片斷:
$(window).bind('hashchange', function(event){
myFunction(event.fragment, /* currentHash */);
});
這可能嗎?
在此先感謝。