Skip to content Skip to sidebar Skip to footer

Persistent Html Outside Of Jquery Mobile Pages

I want to include a bit of HTML outside of the
element on my main page. This HTML shouldn't be replaced when a new page is loaded in via ajax. The exam

Solution 1:

I don't think divs get replaced. For example, this will bring the first unseen div to the top:

http://jsfiddle.net/RQkrj/2/

<!DOCTYPE html><html><head><title>My Page</title><metaname="viewport"content="width=device-width, initial-scale=1"><linkhref="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /><scripttype="text/javascript"src="http://code.jquery.com/jquery-1.6.4.min.js"></script><scripttype="text/javascript"src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script><style>.top {
    z-index: 999;
}
</style><script>
$('div#page').live('pageshow', function(event, ui) {
    $('div#doesNotGetRemoved').addClass("top");
});
</script></head><body><divid="doesNotGetRemoved"style="background: red; position: absolute;">This is a div</div><divid="page"data-role="page"><divdata-role="header"><h1>My Title</h1></div><!-- /header --><divdata-role="content"><p>Hello world</p></div><!-- /content --></div><!-- /page --></body></html>

Post a Comment for "Persistent Html Outside Of Jquery Mobile Pages"