Jquery 类网页微信二维码图块滚动效果具体实现

2020-05-17 06:23:35易采站长站整理

        } 
        if(settings.autoHide) { 
            setTimeout(“(function(){$(‘” + $(this).selector +  “‘).hide();})();”,parseInt(settings.hideSecond) * 1000; 
        } 
        //别名不同导致事件驱动不一样:scroll与onscroll 
        $(window).bind(“scroll”, function(){ 
            var diffY; 
            if (document.documentElement && document.documentElement.scrollTop) 
                diffY = document.documentElement.scrollTop; 
            else if (document.body) 
                diffY = document.body.scrollTop 
                else { 
                    /*Netscape stuff*/ 
                } 
            percent= 1 * (diffY – lastScrollY); 
            if(percent>0) 
                percent=Math.ceil(percent); 
            else  
                percent=Math.floor(percent); 
            if(settings.position==’top’){ 
                var top = czd.css(“top”); 
                czd.css(“top”, parseInt(top) + percent + “px”); 
                lastScrollY += percent; 
            } else { 
                var top = czd.css(“bottom”); 
                czd.css(“bottom”, parseInt(top) – percent + “px”);lastScrollY += percent;