javascript - show hide div on mouseover and mouseout -
<script type="text/javascript"> function show_sidebar() { document.getelementbyid('sidebar').style.visibility="visible"; } function hide_sidebar() { document.getelementbyid('sidebar').style.visibility="hidden"; } </script> <img src="images/cart.jpg" width="80px" height="30px" onmouseover="show_sidebar()" onmouseout="hide_sidebar()"> <div id="sidebar">some thing</div>
this code showing , hiding sidebar div on mouseover , mouseout. working want when have mouseover on image, sidebar div shown , want sidebar div shown when mouse on sidebar. how can u it.
move eventhandlers wrapper div accomplish want.
<div id="wrapper" onmouseover="show_sidebar()" onmouseout="hide_sidebar()"> <img src="images/cart.jpg" width="80px" height="30px"> <div id="sidebar">some thing</div> </div>
Comments
Post a Comment