$(function(){ console.log("技术支持:成都今网科技\nhttps://www.28jw.cn/\n^_^ 猫王欢迎您!\n"); //返回顶部 //$("#totop").on('touchend',function(){ //$("html,body").animate({scrollTop:"0px"},500); //}); ietester(); preani(); $(window).scroll(_animation); if( !$('#fullpage').length){ setTimeout(_animation,200); } //ibanner_full(); //$(window).resize(function(){ibanner_full();}); //模拟下拉点击 $('.xiala .hand').click(function(event){ $(this).siblings('.xialalinks').stop(true,false).slideToggle(300); }) $('.soubtn').click(function(){ if($(this).hasClass('on')){ $('.sou,.soutxt,.soubtn').removeClass('on'); }else{ $('.sou,.soutxt,.soubtn').addClass('on'); } }); $('#totop').click(function(){ var wt = $(window).scrollTop(); var sh = $('body').prop('scrollHeight')-$(window).height(); if(wt>0){ $("html,body").stop(true,false).animate({scrollTop:0},500,'swing'); $(this).find('p').text('回到底部'); }else{ $("html,body").stop(true,false).animate({scrollTop:sh},500,'swing'); $(this).find('p').text('回到顶部'); } }) $('#topsoubtn').click(function(){ $(this).stop(true).toggleClass('on'); $('.topsouout').stop(true).slideToggle(300); }); $(".htel").each(function(){ var strarr = $(this).text().split(""); var res = ""; for (var i = 0; i < strarr.length; i++) { res += ''+strarr[i]+''; }; $(this).text("").append(res); }) //侧边回到顶部的显示隐藏 //$(window).scroll(function(){ // var sh = $(window).scrollTop() || 0; // if(sh<=500){$('#totop').hide();} // else{$('#totop').show();} //}); $('.footwx,.topewm').on('mouseenter', function() { $(this).find('.bigewm').stop(true,true).fadeIn(300); }).on('mouseleave', function() { $(this).find('.bigewm').stop(true,true).fadeOut(300); }) $('.sidesearch').click(function(){ $('.sidesouout').toggleClass('on'); }) $('.sideewm').on('mouseenter', function() { $(this).find('.sidebigewm').stop(true,true).fadeIn(300); }).on('mouseleave', function() { $(this).find('.sidebigewm').stop(true,true).fadeOut(300); }) $('.sidehand').hover(function(){ $(this).find('.sideinfo').toggleClass('on'); }) $(".fside i").click(function(){ $('.fside').toggleClass('zk'); }); $('#liuyanbtn,#liuyanbtn2').click(function() { dinon()}) $('.downlist').on("click","li", function() { dinon()}) //导航下拉菜单 二级菜单 $(".nav>li").hover(function(){ var l = $(this).find('.navtwo'); if(l.length){ l.stop(true).fadeIn().addClass('on');} $(this).siblings('li').find('.navtwo').stop(true).fadeOut().removeClass('on'); },function(){ var l = $(this).find('.navtwo'); if(l.length){ l.stop(true).fadeOut().removeClass('on');} }); //手机导航 $(".navsj a.yiji").click(function(){ var l = $(this).siblings('.navsjtwo'); if(l.length){ $(this).parents('li').stop(true).toggleClass('on'); l.stop(true).slideToggle(300); //$(this).find('s').first().toggleClass('on'); return false; } }); $(".navsj a.mao").click(function(){ $('.navbtn').removeClass('on'); $(".navsjout").removeClass('on'); //$('.head').removeClass('on'); }); $(".navbtn").click(function(){ $(this).stop(true).toggleClass('on'); $(".navsjout").stop(true).toggleClass('on'); //$('#close').fadeToggle(300); $("#topsoubtn").stop(true).removeClass('on'); $('.topsouout').stop(true).slideUp(300); }); //侧面导航 $(".sdnav dd>a").click(function(){ var l = $(this).siblings('.leifour'); if(l.length){ l.stop(true).slideToggle(300); $(this).parent('dd').toggleClass('on'); } }); //招聘展开 $('.zpone').click(function(){ var _li = $(this).parents('li'); if(_li.hasClass("on")){ _li.removeClass('on'); _li.find('.zpcon').removeClass('on'); _li.find('.zphand span').text("展开"); }else{ _li.addClass('on'); _li.find('.zpcon').addClass('on'); _li.find('.zphand span').text("收起"); } }) $('.reclist').on('click','.rec-hand',function(){ var liobj = $(this).parents('li'); var bool = liobj.hasClass('on'); if(!bool){ liobj.addClass('on').siblings('li').removeClass('on'); liobj.find('.rec-con').slideDown('600'); liobj.siblings('li').find('.rec-con').slideUp('600'); }else{ liobj.removeClass('on'); liobj.find('.rec-con').slideUp('600'); } }) $('.helpone').click(function(){ $(this).parents('li').toggleClass('on'); $(this).siblings('.helpcon').slideToggle('300'); }) //首页各种二级切换 $('.js-qieh>*').click(function(){ $(this).addClass('on').siblings().removeClass('on'); var i = $(this).index(); var se = $(this).parent().attr('data'); $('.'+se).find('.js-qiecon').removeClass('on').eq(i).addClass('on'); }); $('.ryerji>a').click(function(){ var i = $(this).index(); $('.swiper-pagination-ry').removeClass('on').eq(i).addClass('on'); }); $('.js-qieh2>*').click(function(){ $(this).addClass('on').siblings().removeClass('on'); var i = $(this).index(); $('.js-qiecon2').removeClass('on').eq(i).addClass('on'); }); $('.jshover-onlyon>*').hover(function(){ $(this).addClass('on').siblings().removeClass('on'); }); $('.jsclick-onlyon>*').click(function(){ $(this).addClass('on').siblings().removeClass('on'); }); //点击动画 $('.ani-clickonce').on('animationend', function(){ var s = $(this).attr('aniname'); if(s) $(this).removeClass(s); }) $('.ani-clickonce').on('click', function(){ var s = $(this).attr('aniname'); if(s) $(this).addClass(s); }) $('.ani-click').on('click', function(){ var s = $(this).attr('aniname'); if(s) $(this).toggleClass(s); }) //表单验证 if($('#liuyan').length){ var liuyan1 = $("#liuyan").Validform({ tiptype:3}); } if($('#liuyan2').length){ var liuyan2 = $("#liuyan2").Validform({ tiptype:3}); } if($('#liuyan3').length){ var liuyan3 = $("#liuyan3").Validform({ tiptype:3}); } //13联系地址滚动 if($('.scrollarea1').length){ $('.scrollarea1').tinyscrollbar({axis: 'y',thumbSize: 100, wheelLock: false}); } //首页banner if($('#home_slider').length){ $('#home_slider').flexslider({animation : 'slide', controlNav : true, directionNav : true, animationLoop : true, slideshow : true, useCSS: false,slideshowSpeed: 6500,animationSpeed: 500, pauseOnHover: false,pauseOnAction:false, mousewheel: false,startAt: 0, before: function (slider){ slider.pause(); slider.play();},prevText:'<',nextText:'>', after:function(slider){ var i = slider.currentSlide; $('.slides li').removeClass('ac').eq(i+1).addClass('ac'); $('.flex-control-paging li').removeClass('ac').eq(i).addClass('ac'); $('#bannum').text('0' + (i+1)); }, start: function(slider){ $('.slides li').removeClass('ac').eq(1).addClass('ac'); $('.flex-control-paging li').removeClass('ac').eq(0).addClass('ac'); $('#bannum').text('01'); $('#bannumall').text('0' + slider.count); } }); } //if($('.flexslider').length){ // var handpause=false;//首页视频手动暂停flag // var flextimer;//视频播放延时计时器 // // $('.flexslider').flexslider({animation : 'slide', controlNav : true, directionNav : true, // animationLoop : false, slideshow : true, useCSS: false,slideshowSpeed: 5000,animationSpeed: 800, // pauseOnHover: false,pauseOnAction:false, mousewheel: false,startAt: 0,prevText:'<',nextText:'>', // after:function(slider){ var i = slider.currentSlide; // if(i==0 && !handpause){ // $('.vd').get(0).play();slider.pause(); // clearTimeout(flextimer); // flextimer = setTimeout( function(){ slider.play()},13000); // }else if(i!=0){ // clearTimeout(flextimer); // $('.vd').get(0).pause();slider.pause();slider.play(); // if(!handpause){ $('.vd').get(0).currentTime=0;} // } // $('.flexslider .slides li').removeClass('ac').eq(i).addClass('ac'); // $('.flex-control-paging li').removeClass('ac').eq(i).addClass('ac'); // $('#bannum').text('0' + (i+1)); // }, // start:function(slider){ // $('.flexslider .slides li').removeClass('ac').eq(0).addClass('ac'); // $('.flex-control-paging li').removeClass('ac').eq(0).addClass('ac'); // $('#bannum').text('01'); // $('#bannumall').text('0' + slider.count); // // $('.vd').get(0).play(); // slider.pause(); // clearTimeout(flextimer); // flextimer = setTimeout( function(){ slider.play()},13000); // } // }); // // // $('.flexslider .vd').click(function(){ // var flex = $('.flexslider').data('flexslider'); // if(this.paused){ // this.play();flex.pause(); handpause = false; // clearTimeout(flextimer); // var t1 = this.duration,t2 = this.currentTime; // console.log(t1,t2); // flextimer = setTimeout( function(){ flex.play()},(t1-t2-3)*1000); // } // else{ // handpause = true; // clearTimeout(flextimer); // this.pause();flex.pause();flex.play(); // } // }) //} //首页,PC图片换SJ图片 $(".resimg").each(function(i,oE) { var ww = $(window).width(); $(oE).attr("src",function(e,a){ var _src=''; $.each($(oE).attr("dataz-srczzz").split("|"),function(i,data) { data=data.split(","); if(ww<=data[0]){_src=data[1]; } }); return _src; }); }); //首页荣誉切换 if($('.frytwo').length){ $(".frytwo").slide({mainCell:".bd ul",autoPage:true,effect:"leftLoop",autoPlay:true,vis:'6', trigger:"click",scroll:1,interTime:3000,delayTime:600,easing:"swing",prevCell:".fryprev", nextCell:".frynext",mouseOverStop:false,opp:true}); } //热点新闻切换 南山中学 if($('.hotscroll').length){ $(".hotscroll").slide({mainCell:".bd ul",titCell:".hd ul",autoPage:true,effect:"leftLoop", autoPlay:true,vis:'1',scroll:1,interTime:4000,delayTime:1000,easing:"easeOutQuad", mouseOverStop:false}); } //首页学生切换 南山中学 if($('.stuscroll').length){ $(".stuscroll").slide({mainCell:".bd ul",titCell:".hd ul",autoPage:true,effect:"leftLoop", autoPlay:true,vis:'1',scroll:1,interTime:4000,delayTime:1000,easing:"swing", mouseOverStop:false}); } //教师,管理列表 南山中学 $('.tmlist li,.ftmlist li').click( function() { var w1 = $('#worker'); var w2 = $(this); if(w2.length){ w1.find('img').attr('src',w2.find('img').attr('src')); w1.find('.name').text(w2.find('h3').first().text()); w1.find('.zhiwei').text(w2.find('h4').first().text()); w1.find('.intro').html(w2.find('.intro').html()); } dinon(); }) //案例详情滚动 远见 if($('.casepic-scroll').length){ $('.casepic-scroll').flexslider({animation : 'slide', controlNav : true, directionNav : false, animationLoop : true, slideshow : true, useCSS: false,slideshowSpeed: 6000,animationSpeed: 600, pauseOnHover: false,pauseOnAction:false, mousewheel: false,direction:"horizontal", before: function (slider){ slider.pause(); slider.play();},prevText:'<',nextText:'>' }); } if( $('.guolist-js .counter').length ){ var cuoption = {useEasing : false,useGrouping : false,separator : '',decimal : '.',prefix : '',suffix : ''}; var ctdemo = [], ct1 = true; // var ctdemo = new CountUp(target, startVal, endVal, decimals, duration, options); var y1 = $('.guolist-js').offset().top; var y2 = y1 + $('.guolist-js').outerHeight(); countUP(); $(window).scroll(countUP); function countUP(){ var wt = $(window).scrollTop() || 0; var wb = wt+ $(window).height(); if( ct1 && y2<= wb && y1>= wt ){ ct1 = false; $('.guolist-js .counter').each(function(i){ var n = $(this).text()-0; var start = n>200? n-200:0; var dura = $(this).attr('counter-time')-0 || 2; var delay = $(this).attr('counter-delay')-0 || 0; ctdemo[i] = new CountUp(this, start, n, 0, dura, cuoption); setTimeout(function(){ctdemo[i].start()},delay) }) } } } if( $('.guolist2-js .counter').length ){ var cuoption2 = {useEasing : false,useGrouping : false,separator : '',decimal : '.',prefix : '',suffix : ''}; var ct2 = true; // var ctdemo = new CountUp(target, startVal, endVal, decimals, duration, options); $('.guolist2-js').find('.counter').each(function(i){ var n = $(this).text()-0; var start = n>200? n-200:0; var dura = $(this).attr('counter-time')-0 || 2; ctdemo2[i] = new CountUp(this, start, n, 0, dura, cuoption2); }) if( !INDEXPC ){ var yy1 = $('.guolist2-js').offset().top; var yy2 = yy1 + $('.guolist2-js').outerHeight(); countUP2(); $(window).scroll(countUP2); function countUP2(){ var wt = $(window).scrollTop() || 0; var wb = wt+ $(window).height(); if( ct2 && yy2<= wb && yy1>= wt ){ ct2 = false; for (var jj = 0; jj < ctdemo2.length; jj++) { ctdemo2[jj].reset(); ctdemo2[jj].start(); }; } } } } //6品胜 合作优势滚动 //$('.guanlist li').click(function(){ // $(this).addClass('on').siblings('li').removeClass('on'); // setScrollPos( Scrollrange,$('#wrap-range') ); //}); if( $('#wrap-range').length>0){ var lis = $('#wrap-range ul li').width()+10; var Scrollrange = new iScroll('wrap-range',{hScrollbar:false, vScrollbar:false,bounce:false}); setScrollPos( Scrollrange,$('#wrap-range') ); $('.guanprev').click(function(){ Scrollrange.scrollTo(-lis, 0, 300, true); }) $('.guannext').click(function(){ Scrollrange.scrollTo(lis, 0, 300, true); }) } //视频播放 $('.vpic').click(function(){ var vd = $(this).find('video').get(0); var iii = $(this).find('i'); if(vd.paused){ vd.play(); //var t1 = vd.duration,t2 = vd.currentTime; iii.fadeOut(300); } else{ vd.pause(); iii.fadeIn(300); } }) //猪鼻孔小圈鼠标跟随 $(".pigdesk").on("mousemove", function(event) { event = event ? event : window.event; var y1 = event.pageY - $(this).offset().top; var x1 = event.pageX - $(this).offset().left; $(this).find(".pig").css({ "top": y1, "left": x1 }); }).hover(function(){ $(this).find(".pig").addClass("show"); },function(){ $(this).find(".pig").removeClass("show"); }).on("mousedown",function(){ $(this).find(".pig").addClass("active"); }).on("mouseup",function(){ $(this).find(".pig").removeClass("active"); }); $('.pigdesk').hover(function(){ $('.cursor-dot').hide(); },function(){ $('.cursor-dot').show(); }); //11资料,性别 $('.sex label').click(function(){ if( !$(this).hasClass('on') ){ $('.sex label').removeClass('on'); $(this).addClass('on'); $(this).siblings('input[type=radio]').get(0).checked= true; } }); followmove_rat('.followmove'); $('.msgbg').click(function(event){ event = event ? event : window.event; if(event.target==this){ msgoff();} }) $('.selfclose').click(function(event){ event = event ? event : window.event; if(event.target==this){ $(this).removeClass('on').fadeOut(300);} }) //11品胜 产品详情点小图,看大图 $('.twlist2').on('click','li',function(){ if(!$(this).hasClass('on')){ $(this).addClass('on').siblings('li').removeClass('on'); bigmove(2,'twlist2',36,'bigpic') } }) $('.xijie-prev').click(function(){bigmove(0,'twlist2',36,'bigpic')}) $('.xijie-next').click(function(){bigmove(1,'twlist2',36,'bigpic')}) // 07 三级导航的滚动 pc版 if( $('#wrapper77').length>0){ var lin = $('#wrapper77 ul li').length; //if(lin<=1){ // $('.outnav7').hide(); return false; //}else if(lin==2){ // $('.nav7').addClass('fen2'); return false; //}else if(lin==3){ // $('.nav7').addClass('fen3'); return false; //}else if(lin==4){ // $('.nav7').addClass('fen4'); return false; //}else if(lin==5){ // $('.nav7').addClass('fen5'); return false; //}else{ // $('.outnav7').addClass('on'); //} //var lis; //if( $(window).width()>750 ){ // lis = $('#wrapper77').width() /5; //}else{ // lis = $('#wrapper77').width() /3; //} var lis = $('#wrapper77 ul li').first().width(); if( lis*lin > $('.outnav7').width()){ $('.outnav7').addClass('on'); $('#wrapper77 ul').width(lis*lin); //Scroll77是 二级导航条水平方向的拖动 var Scroll77 = new iScroll('wrapper77',{hScrollbar:false, vScrollbar:false}); $('.outnav7 .nav-left').click(function(){ Scroll77.scrollTo(-lis, 0, 300, true); }) $('.outnav7 .nav-right').click(function(){ Scroll77.scrollTo(lis, 0, 300, true); }) setScrollPos( Scroll77,$('#wrapper77') ); } } }) function setScrollPos(isname,_wrap){ var _isele = _wrap.find('ul'); var obj = _isele.find('.on'); if(obj.length<=0) return false; var oleft = obj.offset().left; var owidth = obj.outerWidth(); var outleft = _wrap.offset().left; var outwidth = _wrap.outerWidth(); var outright = outleft + outwidth; var inleft = _isele.offset().left; if( oleft < outleft ){ isname.scrollTo((inleft-oleft), 0, 300, false); }else if(oleft + owidth > outright){ isname.scrollTo((inleft-oleft+outwidth-owidth), 0, 300, false); } } function mwon(cname){ $('.'+cname).fadeIn(300).addClass('on');} function mwoff(cname){ $('.'+cname).removeClass('on').fadeOut(300);} function msgon(){ $('.msgbg').fadeIn(300).addClass('on');} function msgoff(){$('.msgbg').removeClass('on').fadeOut(300)} function dinon(){$('#fudin').fadeIn(300).addClass('on');} function dinoff(){$('#fudin').removeClass('on').fadeOut(100);} //数字增长 var ctdemo2 = []; function ibanner_full(){ if( !$('#home_slider').length ) return false; var wh = $(window).height(); var pw = wh * 32/15 ; $('#home_slider .slides').height(wh); $('#home_slider img').height(wh).width(pw).css('margin-left',-pw/2+'px'); } function selfclose(obj){ event = event ? event : window.event; if(event.target==obj){ $(obj).removeClass('on').fadeOut(300);} } function addmsg(){ if($('.msgbg').length<=0){ var ss = '