当前位置: 代码迷 >> JavaScript >> jquery hover()解决办法
  详细解决方案

jquery hover()解决办法

热度:518   发布时间:2013-04-20 19:43:01.0
jquery hover()
 

<!DOCTYPE htm>
    <html lang=en>
        <meta charset='utf-8'/>
        <head>
            <style type="text/css">
                .small_nav a { display: block; height: 50px; width: 100px; background: red;}
                .small_nav div { width: 300px; height: 300px; background: #eee; display: none;}
            </style>
            <script src="http://code.jquery.com/jquery-latest.js"></script>
            <script type="text/javascript">
                $(document).ready(function(){
                    $('.small_nav a').hover(
                                       function () {
                                        $('.submenu').show(1000);
                                       },function(){
                                        $('.submenu').hide(1000);
                                       }
                                       
                                       );
                    });
            </script>
        </head>
        <body>
            <div class="small_nav">
                <a href="#" ></a>
                <div class="submenu">
                    <ul>
  相关解决方案