javascript - change visibility with onmouseover / onmouseout -
i'm trying make img disappear onmouseover event , img reappear onmouseout event here's have far:
<body> <h1>catch easter bunny egg!</h1> <img src="images/rabbit.png" id="rabbit1" onmouseover="" onmouseout="show(this);" alt="catch rabbit"/> <img src="images/rabbit.png" id="rabbit2" onmouseover="hide(this);" onmouseout="show(this);" alt="catch rabbit"/> <img src="images/rabbit.png" id="rabbit3" onmouseover="hide(this)" alt="catch rabbit"/> <img src="images/rabbit.png" id="rabbit4" onmouseover="hide(this)" alt="catch rabbit"/> <h2 id="noeggs">no easter eggs you</h2> <h2 id="yousuck">humans suck!!!</h2> </body> var count = 0; function hide(node) { count += 1; node.style.visibility = 'hidden'; } function show(node) { node.style.visibility = 'visible'; }
try using opacity
node.style.opacity=0;
or
node.style.display='none';
Comments
Post a Comment