GlenStobbs
07-27-2010, 12:29 PM
Hi all
I am using a basic JavaScript toggle function to show/hide a series of <div> blocks.
All works fine, but now what I want to do is create a link to toggle all of them,irrespective of whether they are shown or hidden. All should be shown.
The page in question is at: www.pinosolocal.net/catbrowser.asp
The script I am using for the normal toggle is:
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->
</script>
The div's are defined like this:
<div id="<%=MCat%>" style="display: none">
Any help would be appreciated. I'm no JavaScript fundi, and I've spent too much time on this as it is LOL!
Regards
Glen
I am using a basic JavaScript toggle function to show/hide a series of <div> blocks.
All works fine, but now what I want to do is create a link to toggle all of them,irrespective of whether they are shown or hidden. All should be shown.
The page in question is at: www.pinosolocal.net/catbrowser.asp
The script I am using for the normal toggle is:
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->
</script>
The div's are defined like this:
<div id="<%=MCat%>" style="display: none">
Any help would be appreciated. I'm no JavaScript fundi, and I've spent too much time on this as it is LOL!
Regards
Glen