JQM (jQueryMobile) Problem with AJAX content and f

2019-07-10 05:13发布

I'm using the Multi-page layout (Example), in my case the second page content is being generated by an AJAX call.

My problem is I have the AJAX call(s) to get the next/previous page and load the content (This is working), But some of the content is very long and the user will have to scroll to the top of the page to press/click the next/previous page button(s).

NOTE: I have the next/previous buttons on the top and the bottom of the page

What I would like is if the user clicks the next/previous button to set focus to the top of the page, so if the content page is very large it would start from the top instead of the user scrolling back to the top of the page.

Here is the example/question for my AJAX code

Another problem is in using JQM the anchor hashes <a href='#' are used for page transitions

2条回答
smile是对你的礼貌
2楼-- · 2019-07-10 05:37

You probably want to bind to the event generated after $.mobile.changePage() and have it scroll to the top of the document.

查看更多
登录 后发表回答