码迷,mamicode.com
首页 > Web开发 > 详细

jQuery 屏蔽鼠标快速经过

时间:2015-01-09 16:48:06      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

<script type="text/javascript">
    $(".Banner ul li").bind(‘mouseover‘, function()
    {
        var cur = $(this).index();
        function action()
        {
            $(".Banner ol li").eq(cur).fadeIn(800);
            $(".Banner ol li").eq(cur).children("b").fadeIn(800);
        }
        handle = setTimeout(action, 500);
    }).bind(‘mouseout‘, function()
    {
        clearTimeout(handle)
    });
</script>

导航:

var navFun = function() {
    var mouseover_tid = [];
    var mouseout_tid = [];
 
    $(".header .nav li").each(function(index) {
        $(this).hover(
        function() {
            var _self = this;
            clearTimeout(mouseout_tid[index]);
            mouseover_tid[index] = setTimeout(function() {
                $(_self).addClass("hover").children().children("i, .nav-show").fadeIn(300);
            }, 200);
        },
        function() {
            var _self = this;
            clearTimeout(mouseover_tid[index]);
            mouseout_tid[index] = setTimeout(function() {
                $(_self).removeClass("hover").children().children("i, .nav-show").fadeOut(300);
            }, 200);
        })
    })
}

navFun();

 

jQuery 屏蔽鼠标快速经过

标签:

原文地址:http://www.cnblogs.com/mixzo/p/4213500.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!