I have a tabs effect on a web page and when the page is refreshed it loses the last active tab and goes back to the first tab.
How to make so after the page refresh to remain active the last opened tab?
Has anyone come across this problem and know how to solve it?
Display last active tab after page refresh
-
- Posts:107
Display last active tab after page refresh
Admin
Posts:805
Hi,
You can use the sessionStorage JavaScript object to store data in the browser session, that can be used after page refresh.
You can add data in browser session using this code:
And you can get /use the value associated to "name" with this:
- In this page: Creating Tabs Effect with JavaScript is an example with tabs effect that uses this technique to keep active the last opened tab, after page refresh.
You can use the sessionStorage JavaScript object to store data in the browser session, that can be used after page refresh.
You can add data in browser session using this code:
Code: Select all
sessionStorage.setItem('name', value);
Code: Select all
if(sessionStorage.getItem('name')) {
var some_var = sessionStorage.getItem('name');
}
Similar Topics
- Display message to every minute in Javascript
JavaScript - jQuery - Ajax First post
Hello,Last post
On eatch minute from the current hour I wanna have an message
I can not find out how to complete
I hope to get something like this (code...
If you only want to display a message to every minute, just use the setInterval() function. It calls a function repeatedly, over and over again, at...