Tabbed Content / Posts /

How to make the Default Tab show even after switching to other tabs after Page Reload

0

Hello,

I am designing a single page HTML5 application. I have two Tabs where the 1st Tab is the default. Now, when i switch to Tab 2 then go to some other Page and while returning to the page containing the Tabs, Tab 2 is activated instead of the Default Tab 1. 

How do i make sure Tab 1 is active even after switching Tabs and pages.

Thanks.

Vijay  8 years ago   viewed: 4044    

8 Answers

0

Yes, i did try but it is not working as expected.

<ul class="tabs" data-persist="false">

                    <li class="selected">First</li>

                    <li>Second</li>

                </ul>

                <div class="tabcontents">

                    <div id="one"></div>

                    <div id="two"></div>

               </div>

Vijay   8 years ago
0

I cannot test it as I am on travel and have very limited access to the testing environment.

Can you take the #3 approach in http://www.menucool.com/2457/Troubleshooting-Request

Milo   8 years ago
0

Hello,

I am still having this issue, any inputs will be appreciated.

Thanks.

Vijay   8 years ago
0

Hello, great code by the way. I have the same trouble, the tabs stick on browser refresh. I have added all the above suggestions. Any ideas how to get the tab to go back to the default tab on page refresh?????

All help much appreciated :-)

ccoles3
  8 years ago
0

Do you have any tab that has the class="selected"?

Please post back if it will fix the problem after removing the class="selected".

Thanks!

Milo   8 years ago
0

Yes, I have added the class selected. But is always goes to the last tab opened on refresh.

Ccoles3
  8 years ago
0

After deleting the class="selected" from the HTML, is the problem gone?

If you still have the issue, please stage a testing page online so that I can debug.

Milo   8 years ago
-1

Have you removed data-persist="true" or set it data-persist="false"?

And the tab should not have the class="selected" ( <li class="selected">2nd tab</li> )

Milo   8 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: