Hi, i need some help. Can you help me? Thank you. I got 4 tabs. But when i press refresh button at third tab. it should refresh and remain at tab3 but it keep move to first tab. what code do i need so that i can remain at same tab ? either using cookie?
Have you checked to make sure there are no mistakes in your markup? For example, you have one closing div tag like this </div - see the missing right angle bracket?. Also, what tags are these - <id="tab1">, <id="tab2">, <id="tab3>` ?
Because the whole coding is too long so i cut short it. <id=“tab1”> is to contain all the information in tab1. Please ignore . Because i inset a refresh button at tab3. All these tab are in the same url. What i want is to press refresh button in tab3, It will be able to stay at tab3 instead of moving to tab1 after refresh. Thank you. The coding is as below:
[quote=“forforfor, post:3, topic:224247, full:true”]
What i want is to press refresh button in tab3, It will be able to stay at tab3 instead of moving to tab1 after refresh.[/quote]
The standard way of achieving that is to update the URL with a fragment identifier, denoting which tab is currently active.
When the page loads, the page can check for that fragment identifier and based on it, activate the appropriate tab.
Hello. Thank you for replying. I am new to programming. So i am not very sure how to code it. Trying to find reference online but can’t suit into my programming. Need help badly.
My coding is the same as the coding given. I tried again but when i press refresh at tab3, it will go back to tab1 instead of tab3. ( it doesnt remain at same tab)
jQueryUI is smart enough to watch for the fragment identifier, taking you to the appropriate tab when the page loads.
If you don’t want the URL changing with each tab, you can take a more complex route by storing the tab identifier as a cookie, or in the local storage.
When i use that. Is it normal that my url start to have #tab2/ #tab3/tab1 when i click on each tab ? Because now my html becomes a list instead of tab. Without pressing tab, i am able to scroll from tab1 to tab4 vertically. For that coding, do i put at jquery.ui or just html head section with . So sorry about that. I am new. Thank you for your patient and understanding.
I have tested that above code using the jQueryUI tabs examples, but not with your code because I do not have any working example of your tabs page to work with.