I use jquery tabs and try to get pagination in each of them, but everything works fine, if I click to go to the next page, say on the second tab, it's all good, but it brings me to the first tab to open, so you Youβll need to go to the second tab to view the new content. My question is how can I make it so that when the user clicks the next page paginated, the content is updated, but the same tab remains open.
My plan to include this in my current code is to use the URL mail.php?page=2&tid=2
Where page = 2 is a pagination link that works fine, but I want tid (tab id) to make this tab open.
Here is the javascript for the tabs you could recognize.
$(document).ready(function() { //Default Action $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active content return false; }); });
And html for tabs (had to comment out the lists)
//<div id="tabsX"> <div id="tabContent"> <ul class="tabs"> // // <li><a href="#inbox" class="inbox"></a></li> // <li><a href="#outbox" class="outbox"></a></li> // <li><a href="#compose" class="compose"></a></li> //<li><a href="#trash" class="trash"></a></li> // // </ul>
And html for the contents of the tab (showing only one example without content, as there will be too much to show)
<div id="inbox" class="tab_content"> <div id="inbox_header" style="display:table-cell; vertical-align:middle"> </div> </div>
I would really appreciate any help as I cannot find any solutions for myself
Arken source share