(046)jquery_事件_hover

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>dom_hover.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <style type="text/css">
        div
        {
            width: 160px;
            border: solid 1px #ccc;
            padding:8px;
            text-align:center;
        }
        .orange
        {
            background-color: Orange;
            color:White;
        }
    </style>
    <script type="text/javascript" src="../js/jquery/jquery190.js"></script>
    <script type="text/javascript">
        $(function(){
            $("div").hover(function(){
                $(this).addClass("orange");
            },function(){
                $(this).removeClass("orange");
            });
        });
    </script>
  </head>
  
  <body>
           <h3>hover()方法切换事件</h3>
        <div>别走!你就是土豪</div>
  </body>
</html>

 

posted @ 2014-12-22 11:03  雪中飞雁  阅读(52)  评论(0)    收藏  举报