jquery绑定事件

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript" src="jquery-2.1.1.min.js" ></script>
</head>
<script type="text/javascript">
    $(function(){
//        $("#panel h5.head").bind('click',function(){
//           if($(this).next().is(":visible"))
//           {
//               $(this).next().hide();
//           }else{
//               $(this).next().show();
//           }
//        })
//
//        $("#panel h5.head").bind("mouseover",function() {
//            $(this).next().show();
//        }).bind("mouseout",function(){
//            $(this).next().hide();
//        })
        $("#panel h5.head").mouseover(function(){
            $(this).next().show();
        }).mouseout(function(){
            $(this).next().hide();
        })
    })

</script>
<body>
<div id="panel">
    <h5 class="head">什么是jquery</h5>
        <div class="content">
            as凯迪拉克将阿斯利科技的将sad刻录机阿隆索口袋精灵卡视角两款手机阿德里克将阿斯利大家阿两款手机达拉斯就对啦数据来看
        </div>
</div>
</body>
</html>

  

原文地址:https://www.cnblogs.com/mengluo/p/4939850.html