Jquery.address page jump issue in scrolling scenar

2019-08-23 11:53发布

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条回答
Explosion°爆炸
2楼-- · 2019-08-23 12:34

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

查看更多
登录 后发表回答