function headernav() { //-------- 搜索 --------- $(".searchicon").unbind("click").bind("click", function() { if ($(".searchwrap").is(":hidden")) { $(".searchwrap").fadein(); $(".showphonenav").removeclass("closenav"); $(".codeimgtop").fadeout(); } else { $(".searchwrap").fadeout(); } }); //-------- code --------- $(".ercode").unbind("click").bind("click", function() { if ($(".codeimgtop").is(":hidden")) { $(".codeimgtop").fadein(); $(".searchwrap").fadeout(); } else { $(".codeimgtop").fadeout(); } }); var overflowwid = $("body").css("overflow", "hidden").width(); var windowwid = $("body").removeattr("style").width(); var scrollwid = overflowwid - windowwid; if ($(".showphonenav").hasclass("closenav")) { $(".showphonenav").removeclass("closenav"); } if (windowwid + scrollwid > 991) { $(".headernav").css("height", "auto"); $(".showphonenav").unbind("click"); $(".headernav").show(); $(".subnavcont").hide(); $(".phsearch").hide(); $(".headernav ul li").unbind("mouseenter").bind("mouseenter", function() { $(this).find(".subnavcont").stop(true, true).fadein(); }); $(".headernav ul li").unbind("mouseleave").bind("mouseleave", function() { $(this).find(".subnavcont").stop(true, true).fadeout(); }); } else { $(".headernav").css("height", $(window).height()); $(".headernav").hide(); $(".headernav ul li").unbind("mouseenter"); $(".headernav ul li").unbind("mouseleave"); $(".showphonenav").unbind("click").bind("click", function() { if ($(".headernav").is(":hidden")) { $(this).addclass("closenav"); $(".headernav").stop().slidedown(); $(".searchwrap").hide(); } else { $(this).removeclass("closenav"); $(".headernav").stop().slideup(); $(".searchwrap").hide(); } }); $(".phsearchicon").unbind("click").bind("click", function() { if ($(this).parent().find(".subnavcont").is(":hidden")) { $(this).parent().find(".subnavcont").slidedown().parent().siblings().find(".subnavcont").slideup(); $(".phsearchicon").removeclass("cur"); $(this).addclass("cur"); } else { $(this).parent().find(".subnavcont").slideup(); $(this).removeclass("cur"); } }); } } headernav(); $(window).resize(function() { headernav(); }); function resizew() { if ($(".headercont").height() >= 70) { var nownum = 1; if (nownum != oldnum1) { $(".indexbanner img").each(function() { $(this).attr("src", $(this).attr("pcsrc")); }); oldnum1 = nownum; } } else { var nownum = 0; if (nownum != oldnum1) { $(".indexbanner img").each(function() { $(this).attr("src", $(this).attr("ydsrc")); }); oldnum1 = nownum; } } } var oldnum1 = -1; resizew(); $(window).resize(function() { resizew(); }); $(function(){ //-------- banner -------- if ($(".indexbanner").length > 0) { var myswiper = new swiper('.indexbanner', { loop: true, autoplay: 5000, speed: 1000, pagination: '.indexbannerbtn p', paginationclickable: true, preventclicks: false, autoplaydisableoninteraction: false, grabcursor: false, parallax: true }); } $('.rutntop').click(function(){ $('html,body').animate({ scrolltop: $('html,body').offset().top }, 600); }); $('.topbackons').click(function(){ $('html,body').animate({ scrolltop: $('html,body').offset().top }, 600); }); function videocont() { var resizewin = $(window).height(); var scrolltop02 = $(window).scrolltop(); var vidhe = $(".videoplay").height(); $(".indexthree .vodelis ").click(function () { $(".indexfloat").fadein(); $(".videoplay").fadein(); var thisvideo = $(this).find(".vodeicon").attr("rel"); $(".videoplay").find("video").attr("src", thisvideo); }); } videocont(); $(".closegrade").click(function () { $(".indexfloat").fadeout(); $(".videoplay").fadeout(); $(".videoplay").find("video").attr("src", ""); }); $(".indexfloat").click(function () { $(".videoplay").fadeout(); $(".videoplay").find("video").attr("src", ""); $(this).fadeout(); }); $('.jbzl-li').eq(0).show(); $('.jbzl-bottom ul li').click(function(){ var n = $(this).index(); $(this).addclass('on').siblings().removeclass('on'); $('.jbzl-li').eq(n).show().siblings().hide(); }); //招聘 $(".hsh_zp li").eq(0).find("h3").addclass("cur"); $(".hsh_zp li").eq(0).find(".yinyzhaop").show(); $(document).on('click', '.hsh_zp li h3', function () { if ($(this).next().is(":hidden")) { $(".yinyzhaop").slideup(300); $(".hsh_zp li h3").removeclass("cur"); $(this).addclass("cur"); $(this).next().slidedown(300); } else { $(this).removeclass("cur"); $(this).next().slideup(300); } }) $(".cpxp-tit li").eq(0).addclass("cur"); $(".prochanglist").eq(0).show(); $(".cpxp-tit li").unbind("click").bind("click",function () { var probtn = $(this).index(); $(this).addclass("cur").siblings().removeclass("cur"); $(".prochanglist").eq(probtn).show().siblings(".prochanglist").hide(); }); if ($(".xiangcp-nr li").length > 0) { var swiper = new swiper('.xiangcp-nr', { nextbutton: '.productimgarrowleft', prevbutton: '.productimgarrowright', paginationclickable: true, slidesperview: 4, breakpoints: { 1024: { slidesperview: 4 }, 768: { slidesperview: 3 }, 640: { slidesperview: 2, spacebetween: 8 }, 320: { slidesperview: 1, spacebetween: 8 } } }); } // $(".procp li").each(function(){ // $(".procp li").hover(function(){ // $(this).find(".cpinfos").show().animate({top:"0px"},200) // },function(){ // $(this).find(".cpinfos").hide().animate({top:"200px"},200); // }) // }) inw =$(window).width(); if (inw>1365) { $(".more_s").hover(function(){ $(".more_s").animate({top:"-10px"},200) },function(){ $(".more_s").animate({top:0},200); }) } // const cas = document.queryselector('.musical'); // const ctx = cas.getcontext('2d'); // const ch = cas.height = 50; // const meterwidth = 2; // let w = document.getelementsbytagname('body')[0].offsetwidth; // let cw = cas.width = (w-320)/2; // const meternum = cw / (meterwidth + 1); //count of the meters // const gradient = ctx.createlineargradient(0, 0, 0, ch); // let vm = this; // function renderframe() { // // gradient.addcolorstop(1, '#ddd'); // ctx.fillstyle=gradient; // ctx.fillrect(0,0,cw,ch); // ctx.clearrect(0, 0, cw, ch); // let arr = []; // for (let i=0; i { // w = document.getelementsbytagname('body')[0].offsetwidth; // cw = cas.width = (w-320)/2; // } //2019 05 30 videoauto('.profile'); videoauto('.newssin'); function videoauto(view){ if($(view).find('video').length){ var viewtop = $(view).find('video').offset().top; var scollh = $(window).scrolltop(); if(viewtop - scollh < 800){ $(view).find('video').prop('preload','autoplay'); } $(window).scroll(function(){ viewtop = $(view).find('video').offset().top; scollh = $(window).scrolltop(); if(viewtop - scollh < 800){ $(view).find('video').prop('preload','autoplay'); } }); } } }); /*20200623修改*/ $(function(){ // $('.coursebox .text').each(function(){ // /* var _html = $(this).html(); // _html = _html.replace(/\s*/g,"").replace(/ /g,""); // console.log(_html); // $(this).html(_html); */ // }) }); /* 2021年11月17日11:08:44 */ $(".footone a").last().hide();