鼠标移动特定位置事件

//鼠标移动到某一个位置时,触发的事件。
        //绑定事件
        $(window).bind('scroll', function () {
            //算出鼠标移动到顶部的高度。
            var scrollt = document.documentElement.scrollTop + document.body.scrollTop;
            //alert(scrollt);
            if (scrollt > 200) {
                //alert("弹出框来啦。");
                $(".container").fadeIn(500);
                //进行操作。
            } else {
                $(".container").fadeOut(500);
                //进行其他操作
            };
        });

posted on 2018-02-27 11:38  小败哥哥。  阅读(167)  评论(0编辑  收藏  举报

导航