javascript - tabcontainer with active tab when page load -


i using tabcontainer 3 tabs.using css tabcontainer,not ajax tabcontainer.then set automatic refresh of every 1 minute.now select tab2,but when page refresh automatically go tab1.so how maintain selected tab when page load or refresh,i want jquery.please me.i trying,tab click event got tab selected index,then value pass page load,but not working,is other way keep selected tab when page load.cookies try no use,then hidden field used,but don't know how hidden value cs page.my code

<div id="nav" class="tabnav" style="width: 80%; height: auto; float: left; margin-left: 8.9%;" onclick="pageload()">     <ul class="tabnav" id="tab">         <li><a href="#nogo" title="address info" linkrel="#tab-1">address info</a>         </li>         <li><a href="#nogo" title="additional info" linkrel="#tab-2">additional info</a>         </li>         <li><a href="#nogo" title="payment &amp; job info" linkrel="#tab-3">payment info</a>         </li>         <li></li>     </ul> </div>  <div class="full" id="tab-1">//some dada</div> </div> <div class="full" id="tab-2">//some dada</div> </div> <div class="full" id="tab-3">//some dada</div> 

variables set js won't exist across multiple pages. add variable uri before refresh, , use select appropriate tab:

$("#nav").bind('tabsselect', function(e, ui) {     window.location.href = window.location.href + "?tab=" + ui.index; }); 

...now, when refresh page can search uri tab variable , select appropriate index. there is, of course, more in-depth uri checking ensure appropriately build new window.location value.

consider:

if explored hidden field approach, assuming you're storing index in field, can access value $('#hiddenfieldid').val() , set tab via $('#nav').tabs({ selected: $('#hiddenfieldid').val() });


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -