I am trying to add a bookmark as normal on my jquery mobile page but it is interpreted as page transition. How to set then a bookmark if using jquery mobile?
<a name="Ancla" id="a"></a> <!--setting bookmark-->
<a href="#Ancla">Ancla</a> <!--link-->
jQuery Mobile docs states:
Since we use the URL hash to preserve Back button behavior, using page anchors to jump down to a position on the page isn’t supported by using the traditional anchor link (#foo). Use the silentScroll method to scroll to a particular Y position without triggering scroll event listeners. You can pass in a yPos arguments to scroll to that Y location. For example:
Here’s a new jsFiddle to what you can do instead: http://jsfiddle.net/dmNqj/3/
What I’m doing is using their mobile silentScroll function and finding the top position of the element you want it to go to.
UPDATE 2: Since jQMobile’s experimental ‘scrollView’ plugin disables
$.mobile.silentScroll, Here’s a jsFiddle using jQuery’s nativescrollTopfunction: http://jsfiddle.net/dmNqj/6/