I have the following scenario for mobile development using HTML5 (using HTML5 and jquerymobile)
How to restrict a page scrolling to the top before it navigates to the next screen?
I have page1, where there is a button on the bottom of the page (it needs to be scrolled-down to the bottom to find the button). This button, when clicked should navigate to an another page- say page2.
Being on bottom of the page, when I click on the button - the page1 is first going to the top and then navigating to page2. Is there a way to restrict this process? - the navigation should happen from page1 to page2 directly from bottom of page1
Here's some code to follow --
<div data-role="page" data-theme="b" id="shopsMenuPage">
<div data-role="content" >
<h3>Shops & Hangouts</h3>
<ul data-role="listview" data-inset="true" data-theme="c" >
<li id="restaurantsList" data-icon="info"><a href="#foodNBeverages" data-transition="slide"><img src="images/foodNBeverages.png" />
<h3> Food & Beverages</h3>
</a></li>
<li id="dutyFreeList" data-icon="info"><a id="dutyFree" href="#foodNBeverages" data-transition="slide"><img src="images/dutyFree.png"/>
<h3> Duty Free Shops</h3>
</a></li>
<li id="florists" data-icon="info"><a href="#foodNBeverages" id="flowers" data-transition="slide"><img src="images/flowers.png" />
<h3> Flower Shops</h3>
</a></li>
<li id="bookShopList" data-icon="info"><a href="#foodNBeverages" id="books" data-transition="slide"><img src="images/bookShop.png" />
<h3> Book Shops</h3>
</a></li>
<li id="musicStores" data-icon="info"><a href="#foodNBeverages" id="music" data-transition="slide"><img src="images/music.png" />
<h3> Music Store </h3>
</a></li>
<li id="garAndAcc" data-icon="info"><a href="#foodNBeverages" data-transition="slide"><img src="images/garments.png" />
<h3> Garments & Accessories </h3>
</a></li>
</ul>
</div>
</div>
This is actually a listview (jquerymobile), with multiple <li>
s - each href
-ed to a new page.
Now, when I scroll down to the last <li>
and click on it to navigate to next screen, the screen is first moving to the first <li>
and then navigating to the next screen.
As mentioned earlier, this is not for a website, it is for a mobile app being developed with html5 and jquerymobile