|
In my site I've added this js script that show hides two different <div>, in fact when one is displayed, and the second hidden and vice-versa.
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
function toggle_visibility2(id) {
var e = document.getElementById(id);
if(e.style.display = 'none')
e.style.display == 'block';
else
e.style.display = 'block';
}
//-->
</script>
These are the links from which the js is activated (they're part of the two different <div>).
<a href="#LinkArea1" name=Area1 onclick="toggle_visibility2('primasezione'); toggle_visibility('secondasezione');">Link1</a>
<a href="#LinkArea2" name=Area2 onclick="toggle_visibility('primasezione'); toggle_visibility2('secondasezione');">Link2</a>
My problem is that both are placed in a page that is auto-reloaded after 60 seconds, and when the second <div> is shown (and the first hidden), the page is reloaded with the first <div> visible and the second hidden, even if the user has used the link to close the first and display the other. There is any way to show the one selected at the moment of the refresh? Thank you for any help.
|