show hide div on mouseover and mouseout

前端 未结 7 1160
误落风尘
误落风尘 2021-01-03 04:42


        
相关标签:
7条回答
  • 2021-01-03 05:28

    try

    <script type="text/javascript">
    function show_sidebar()
    {
    document.getElementById('sidebar').style.display="block";
    }
    
    function hide_sidebar()
    {
    document.getElementById('sidebar').style.display="none";
    }
    </script>
    
    <img src="images/cart.jpg" width="80px" height="30px" onMouseOver="show_sidebar()"     onMouseOut="hide_sidebar()">
    
    <div id="sidebar">some thing</div>
    
    0 讨论(0)
提交回复
热议问题