How to integrate jQuery UI.Layout Plug-in in AJAX site? -
i successful used jquery ui.layout plug-in in test pages, failed when tried integrate layouts in ajax website.
when load page uses layouts ok first time, second time try load same page layout plugin don't work. simplifying i've noted problem not ajax, else layout plugin. simplest example i've found:
function m() { $("body").html('xxx'); } function m2() { $("body").html('<div class="ui-layout-west">west</div><div class="ui-layout-east">east</div><div id="maincontent"></div>') outerlayout = $("body").layout( layoutsettings_outer ); } $(document).ready( function() { m2(); settimeout("m()", 3000); settimeout("m2()", 5000); });
when document loaded, layout ok. after 3 seconds layout disapears (as expected), , 2 seconds later original page back, every div works if layout plugin not loaded.
i'll answer own question:
outerlayout.destroy() resolves problem. must called if unload layout div. in case, enough call destroy() before $("body").html('xxx'); (first line in m() function).
Comments
Post a Comment