function headerSelect(ele,i){ $(ele[i]).addClass("cur"); } function clickSelect(ele,i){ $(ele).eq(i).click(); console.log($(ele).eq(i)) } function is_weixn(ele){ var ua = navigator.userAgent.toLowerCase(); var u = navigator.userAgent; var device =""; //当前设备信息 if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ) {//安卓手机 device = "Android"; if(ua.match(/MicroMessenger/i)=="micromessenger") { $(ele).on("click",function(){ alert("请点击右上角“在浏览器中打开”,发送邮件"); }) return true; } else { return false; } } else if (u.indexOf('iPhone') > -1) {//苹果手机 device = "iPhone"; } else if (u.indexOf('Windows Phone') > -1) {//winphone手机 device = "WindowsPhone"; } } function scrollAnimation(ele) { $(ele).each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.7) { //预先加载图片begin var arrayimg2 = []; arrayimg2.push(_this.find('img').attr('src')); _PreLoadImg(arrayimg2,function(){ // 执行函数 _this.addClass('animate'); // _this.find(".k10 .ul").addClass('animate'); _this.find(".loading-sw").remove(); }) //预先加载图片end } }); $(window).scroll(function() { $(ele).each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() > _this.offset().top - $(window).height() * 0.7) { _this.addClass('animate'); // _this.find(".k10 .ul").addClass('animate'); _this.find(".loading-sw").remove(); } }); }); } function scrollAnimation2(ele) { $(ele).each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() >= _this.offset().top - $(window).height() * 0.8) { _this.addClass('animate'); // _this.find(".k10 .ul").addClass('animate'); _this.find(".loading-sw").remove(); } }); $(window).scroll(function(){ $(ele).each(function() { var _this = $(this); if (_this.offset().top > $(window).scrollTop() + $(window).height() || _this.offset().top < $(window).scrollTop() - _this.outerHeight()) { // _this.removeClass('animate'); } else if ($(window).scrollTop() >= _this.offset().top - $(window).height() * 0.8) { // console.log($(window).scrollTop() ,_this.offset().top - $(window).height() * 0.8) _this.addClass('animate'); // _this.find(".k10 .ul").addClass('animate'); _this.find(".loading-sw").remove(); } }); }); } scrollAnimation2($('.section-contact')); // $(window).scroll(function(){ // scrollAnimation2($('.section')); // }) $(window).scroll(function() { var top = ($(window).scrollTop() / 3); $(".conbanner").css("background-position-y"); $(".conbanner").css({'background-position-y': top,'background-size':"cover"}); });