In JQuery Mobile I am using changePage() to redirect back to a previous page, using the following.
$.mobile.changePage( previousPage.prevObject[0].id, { transition: "slide"} );
This all works fine. What I am having problems with is, if I am trying to clear the HTML elements from the page that I am leaving. using the following –
$('#navigation').html('');
This does not happen. If I use the correct back button provided in the JQuery Mobile UI such as this –
<a href="" onclick="clearNavigation();" data-rel="back">Back</a>
The onclick being the function to clear the HTML elements… this way works, but the animation is slow. It will first clear the HTML elements leaving a blank page and the redirect back to the previous page. This just does not look smooth. Is there a way I can redirect back and then remove the elements. to seem like I have speeded up the transition?
Thanks
Rory
PS – The function I currently have for clearNavigation() –
function clearNavigation(){
$.mobile.changePage( previousPage.prevObject[0].id, { transition: "slide"} );
$('#navigation').html('');
}
I’m not sure if this is what you’re looking for but have you tried
jqmRemoveData()function?