I’m using a Java Script Show/Hide DIV Toggler I found here. It works, but with the side effect that each click on the toggle takes me to the top of the page. Checked in FF and Chrome, same deal in both browsers. I can’t tell for sure if it’s restarting the page but I know it’s not reloading it.
Here’s the script:
<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';
}
//-->
</script>
This is the toggle (notice the href=”#” – is that the problem?):
<a href="#" onclick="toggle_visibility('gallery_info');">[Click to see more details]</a>
And this is the div being shown/hidden (as you can see it starts hidden):
<div id="gallery_info" style="display: none;">
Any ideas?
Thanks a lot!
Alex
use javascript: as href instead of #