Jquery.address page jump issue in scrolling scenarios: $.address.wrap()?

不想你离开。 提交于 2019-12-11 15:48:37

问题


How to use the "wrap" method of jquery.address?

I'm trying to avoid page scrolling jump when i call the $.address.change(fn). Jquery.address add # to my url so by default page suddenly scroll to top... ooh this drive me crazy..

$.address.wrap() Returns: Boolean Provides the state of the wrap mode. Disabled by default.

$.address.wrap(value) Returns: jQuery Address Enables or disables the wrap mode which generates a DIV wrapper around the page content and fixes any scroll issues caused by the use of hash fragments.


回答1:


I have never used wrap() before, but avoided scrolling with return false; at the end of the $.address.change(fn).



来源:https://stackoverflow.com/questions/4284596/jquery-address-page-jump-issue-in-scrolling-scenarios-address-wrap

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