营销H5效果库

锚点动态滚动
$('a[href*=#],area[href*=#]').click(function(){
           if(location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname){
               var $target = $(this.hash);
               $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
               if($target.length) {
                   var targetOffset = $target.offset().top;
                   $('html,body').animate({scrollTop: targetOffset},800);
                   return false;
               }
           }
       });
滚动滚动,页面模块向上飘动
function fn(){
    var n = $(window).scrollTop();
        $(".com_title").each(function() {
            var i = $(this).offset().top;
            $(this).hasClass("bounceInUp1") || i - n < $(window).height() / 2.7 * 2 && $(this).addClass("bounceInUp1");
            $(this).next().hasClass("bounceInUp1") || i - n < $(window).height() / 2.7 * 2 && $(this).next().addClass("bounceInUp1");
        })
}
    //上滑效果
    var Index = function() {
            //默认执行一次 针对刷新页面
        fn();
        $(window).scroll(function() {
            fn();
        })
    }();
.bounceInUp1 {
    opacity: 1 !important;
    top: 0 !important;
}
.com_title{
    opacity: 0;
    top: 70px;
    transition: all .5s .3s;
    -webkit-transition: all .5s .3s;
    -moz-transition: all .5s .3s;
}
//next
.bg .cont{ position: relative;
    opacity: 0;
    top: 70px;
    transition: all .5s .6s;
    -webkit-transition: all .5s .6s;
    -moz-transition: all .5s .6s;
}
相关文章
相关标签/搜索