$(function() { var url = window.location.href; if(url.indexOf('aspx') < 0 && url.indexOf('html') > 0) { // 澶撮儴鍔犺浇 $("#header").load("header.html", function() { //婊戝潡 var Stime1 = 300, Sli1 = $('.nav li'), Slia1 = $('.nav li.curr'), Sline1 = $('.subline'), Sul1 = $('.nav'); if(Sli1.length > 0) { var Slider1 = new Slider(Stime1, Sli1, Slia1, Sline1, 0, Sul1); } }); $("#footer").load("footer.html"); }else{ var Stime1 = 300, Sli1 = $('.nav li'), Slia1 = $('.nav li.curr'), Sline1 = $('.subline'), Sul1 = $('.nav'); if (Slia1.length) { var Slider1 = new Slider(Stime1, Sli1, Slia1, Sline1, 0, Sul1); } else{$('.nav li').eq(0).addClass("curr"); Slia1=$('.nav li').eq(0); var Slider1 = new Slider(Stime1, Sli1, Slia1, Sline1, 0, Sul1);} } // wow if($(".wow").length) { if(!(/msie [6|7|8|9]/i.test(navigator.userAgent))) { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 50, mobile: true, live: true }); wow.init(); }; } if($(".c_p").length) { $(".c_p").each(function() { var p_w = parseInt($(this).width()); var em_w = Math.ceil($(this).find("em").width()); $(this).find("strong").width(p_w - em_w); }); } // 鍏辩敤婊戝姩 if($(".picScroll-left .bd li").length > 3) { $(".picScroll-left .btn").show(); jQuery(".picScroll-left").slide({ titCell: ".hd ul", mainCell: ".bd ul", autoPage: true, effect: "left", vis: 3 }); } if($(".c_picScroll .bd li").length > 3) { $(".c_picScroll .btn").show(); jQuery(".c_picScroll").slide({ titCell: ".hd ul", mainCell: ".bd ul", autoPage: true, effect: "left", vis: 3, prevCell: ".c_prev", nextCell: ".c_next" }); } // if($(".community .c_picScroll .bd li").length>2){ // $(".community .c_picScroll .btn").show(); // jQuery(".community .c_picScroll").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",vis:2,prevCell:".c_prev",nextCell:".c_next"}); // } // if($(".community2 .c_picScroll .bd li").length>2){ // $(".community2 .c_picScroll .btn").show(); // jQuery(".community2 .c_picScroll").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"left",vis:2,prevCell:".c_prev",nextCell:".c_next"}); // } // about4_婊戝潡 if($(".about4 .hd .this").length) { setSlipNav(".about4 .hd .this", ".about4 .hd li.on", ".about4 .hd"); } // 寤惰繜鏃堕棿 $(".anim").each(function() { var num = $(this).attr("data-time"); $(this).css({ "-moz-animation-delay": num, "-webkit-animation-delay": num, "-o-animation-delay": num, "animation-delay": num }); }); //涓嬫媺 $(".c_down").each(function(){ var s=$(this); var z=parseInt(s.css("z-index")); var dt=$(this).children("span"); var dd=$(this).children("ul"); var _show=function(){dd.slideDown(200);s.css("z-index",z+1);dt.addClass("on")}; //灞曞紑鏁堟灉 var _hide=function(){dd.slideUp(200);s.css("z-index",z);dt.removeClass("on")}; //鍏抽棴鏁堟灉 dt.click(function(){dd.is(":hidden")?_show():_hide();}); dd.find("li").click(function(){dt.html($(this).html());_hide();}); //閫夋嫨鏁堟灉锛堝闇€瑕佷紶鍊硷紝鍙嚜瀹氫箟鍙傛暟锛屽湪姝ゅ杩斿洖瀵瑰簲鐨勨€渧alue鈥濆€ 锛 $("body").click(function(i){ !$(i.target).parents(".c_down").first().is(s) ? _hide():"";}); }); }); $(window).load(function() { // 宸﹁竟妯℃澘楂樺害 if($(".c_w_l").length) { var hei = $(".c_w_r").parent().innerHeight(); $(".c_w_l").innerHeight(hei); } Product_list(); // 瀛愭粦鍧 if($(".sub_slider").length) { Slider(300, $(".sub_nav .ul a"), $(".sub_nav .ul a.on"), $(".sub_slider"), 30, $(".sub_nav")); } // 鍔ㄧ敾 $(".anim").addClass("animated"); if($(".tab_wr").length) { setSlipNav(".slide_chunk", ".tab_wr .hd .on", ".tab_wr"); } }); $(window).scroll(function() { var top = $(window).scrollTop(); if(top > 40) { $("body").addClass("start"); } else if(top < 30) { $("body").removeClass("start"); } if(top > 400) { $("#go_top").stop().fadeIn(); } else { $("#go_top").stop().fadeOut(); } }); // index if($(".home").length){ // $("#movie1 video")[0].oncanplay = function() { // $("#movie1 video")[0].play(); // } } $(".i_it_wr .item").hover(function() { $(".i_it_wr .item").removeClass("on"); $(this).addClass("on"); }, function() { $(".i_it_wr .item").removeClass("on"); }); function Product_list() { var hei = $(".Product_list .c_top_lump").height() - 387; $(".Product_list .bg_color").height(hei); $(".product_list_wr .console .row").click(function() { $(this).addClass("on").siblings('.line').removeClass("on"); $(".product_list_wr").addClass("on"); $(".Product_list .bg_color").hide(); }); $(".product_list_wr .console .line").click(function() { $(this).addClass("on").siblings('.row').removeClass("on"); $(".product_list_wr").removeClass("on"); $(".Product_list .bg_color").show(); var hei = $(".Product_list .c_top_lump").height() - 387; $(".Product_list .bg_color").height(hei); }); $(".Product_list .seek_box input").focus(function() { $(this).parents(".seek_box").addClass("on"); }); $(".Product_list .seek_box input").blur(function() { $(this).parents(".seek_box").removeClass("on"); }); } // 瀛愬鑸 婊戝潡 function setSlipNav(slideLump, liOn, nav) { //鍒濆鍖栨粦鍧 $(slideLump).css({ 'top': parseInt($(liOn).position().top) + 'px' }); $(nav).find("li").mouseenter(function(e) { //绉诲姩婊戝潡 $(slideLump).stop().animate({ top: parseInt($(this).position().top) + 'px' }, 300); e.stopPropagation(); }); $(nav).mouseleave(function(e) { //绉诲姩婊戝潡 $(slideLump).stop().animate({ top: parseInt($(liOn).position().top) + 'px' }, 600); e.stopPropagation(); }); }; // 婊戝潡鏂规硶 function Slider(Stime, Sli, Slia, Sline, Sleft, Sul) { Sline.css({ 'width': Slia.width(), 'left': parseInt(Slia.position().left) + Sleft }); Sli.mouseenter(function() { Sline.stop().animate({ width: $(this).width(), left: parseInt($(this).position().left) + Sleft }, Stime); }); Sul.mouseleave(function() { Sline.stop().animate({ width: Slia.width(), left: parseInt(Slia.position().left) + Sleft }, Stime); }); }; // top function setSlipNav(slideLump, liOn, nav) { //鍒濆鍖栨粦鍧 $(slideLump).css({ 'top': parseInt($(liOn).position().top) + 0 + 'px' }); $(nav).find("li").mouseenter(function(e) { //绉诲姩婊戝潡 $(slideLump).stop().animate({ top: parseInt($(this).position().top) + 0 + 'px' }, 300); e.stopPropagation(); }); $(nav).mouseleave(function(e) { //绉诲姩婊戝潡 $(slideLump).stop().animate({ top: parseInt($(liOn).position().top) + 0 + 'px' }, 600); e.stopPropagation(); }); };