scollTo + hashchange: Weird back/forward behavior

戏子无情 提交于 2019-12-13 02:27:55

问题


I'm trying to use Ariel Fiesler's scrollTo plugin in conjunction with Ben Alman's hashchange plugin. Basically I'm scrolling to different DIVs on my page, and trying to use hashchange for back/forward button functionality.

It sort of works, but it's inconsistent. On every other back or forward, it scrolls. But on the others it just jumps to the scroll position. So you get something like: 1. Jump, 2. Scroll, 3. Jump, 4. Scroll and so on.

Here's a link to the live site: http://www.6by7.net/

And the plugins I'm using:
http://flesler.blogspot.com/2007/10/jqueryscrollto.html
http://benalman.com/projects/jquery-hashchange-plugin/

来源:https://stackoverflow.com/questions/8883710/scollto-hashchange-weird-back-forward-behavior

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!