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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -