the default and most commonly used behaviour in jquery mobile when clicking on a button is to hide/destroy the current page and load the referring page.
In a project i use the slideup transition and i want to keep the whole current page and juts append the next page after pressing a button.
I created this fiddle for illustration (with the normal behaviour):
Is there a way to do so?
Accordingly if i press a back button, only the last page should be hidden.
It should be always possible to scroll up to already visited pages.
I’m sorry for my bad english. Hope everybody understands.
Yes you can do this, look up jQM’s
hashListeningEnabledoption, you will need to turn this off and handle it yourself.Basically when you navigate to pages in jQM, it tracks your pages in the url with the value after the # hash. Now the interesting thing is that the browser counts a new hash as a new page, even though you’re still technically on the same page – jQM normally polls this value and if it changes shows the correct page. and when you press back on the browser, it remembers the last hash value, that’s the critical thing you want
Anyways what you need to do is that when the user slides up new content, you change the hash value, that way when they press “back” you can handle for it and bring back the previous content