开发者

prevent scrolling to top of page with iscroll?

开发者 https://www.devze.com 2023-02-14 06:17 出处:网络
I use jqtouch and iscroll for my app. I load all pages with ajax and when I go back from a ajax loaded 开发者_开发问答page to the index (menulist) page, that page scrolls to the top.

I use jqtouch and iscroll for my app. I load all pages with ajax and when I go back from a ajax loaded 开发者_开发问答page to the index (menulist) page, that page scrolls to the top. How can I prevent this? Thanks.


have you tried to set the option checkDOMChanges to false?


I believe there is a boolean option called topOnDOMChanges

var scroll = new iScroll(contentid, {
                          desktopCompatibility: true,
                          bounce: true,
                          momentum: true,
                          checkDOMChanges: false,
                          topOnDOMChanges: false
                        });

From the Beedesk fork of JQTouch https://github.com/beedesk/jQTouch/blob/master/demos/main/index.html

0

精彩评论

暂无评论...
验证码 换一张
取 消