What action do I need to use to hide or show a div, and everything it contains. I know that it needs a seperate ID, and how to call the function, but I need to know the action.
My current way of going about this(without the action of course).
Code:
<script type="text/javascript">
hcur=0
function hidelast(){
switch(hcur){
case 0:
hide div0
break
case 1:
hide div1
break}
}
function header_main(){
if ( hcur!=0 ){
hidelast()
hcur = 0
show div0}
}
function header_diff1(){
if ( hcur!=1 ){
hidelast()
hcur = 1
show div1}
}
</script>
...
<div id="div0">
<a href="url"><img onmouseover="header_main()"></a>
</div>
<div id="div1">
<a href="url"><img onmouseover="header_diff1()"></a>
</div>
I'm asking for just the action on hiding/showing a div, but if anyone can see something obvious wrong with my logic please, point that out too, this is my first time writing JS. This is intended for about 5 divs.