在滑动到新页面之前防止自动滚动到顶部 JqueryMobile
我的页面中有几个可折叠块(div),其中包含列表视图。这些列表非常长(每个大约 100-200 个元素。)当我取消折叠一个块、向下滚动页面并单击/点击列表中的一个元素时,页面会滚动到顶部,然后滑到下一个页。
这种行为有点烦人,而且看起来不太好。我有什么办法可以阻止这种行为吗?
如果您对我的帖子有任何其他问题,请随时询问我。
提前致谢。
I have several collapsible blocks (divs) in my page with listviews inside them. The lists are pretty long (about 100-200 elements each.) When I un-collapse a block, scroll down a page, and click/tap one of the element in the list, the page scrolls to the top before sliding to the next page.
This behavior is somehow annoying and doesn't look good. I there any way to prevent this behavior?
If you have any additional question about my post, don't hesitate to ask me.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你使用带有“#”作为href的链接,它会跳到页面顶部,但是如果你添加“return false;”执行你的代码后,它不会跳起来。示例:
我不确定这是否是您正在考虑的问题。
If you use a link with "#" as href, it will jump up to the top of the page, however if you add "return false;" after the exectution of your code, it won't jump up. Example:
I'm not sure if this is what you were thinking about though.