/** * Created by Administrator on 2017/11/13. */ $(function(){ //screen-width var windowWidth = $(window).width(); //phone-nav //second-nav if(windowWidth>1200){ $(".nav1>li").hover(function(){ var idx = $(this).index(); if(idx==1){ $(".second-nav").addClass("active"); $(this).children("ul").removeClass("active"); }else{ $(".second-nav").removeClass("active"); } }); //$(".scd-sml-box").hover(function(){ // $(".nav1 > li:nth-child(2)>span.shitdeng").show(); //},function(){ // $(".nav1 > li:nth-child(2)>span.shitdeng").hide(); // $(this).slideUp(); //}); $(".headers").hover(function(){ },function(){ $(".second-nav").removeClass("active"); }); }; //phone-href-javascript:; if(windowWidth<1200){ //if ( $(".nav1 li").is(':has(ul)') ) { // $(".nav1 li>a").attr("href","javascript:;"); //}; $(".nav-box ul> li").click(function(){ if($(this).is(":has(ul)")){ $(this).children("a").attr("href","javascript:;") } $(this).children("ul").slideToggle(); $(this).children("a").addClass("active").siblings("li").children("a").removeClass("active"); }); }else{}; //searchBox $(".searchIcon").click(function(){ $(".searchFormBox").slideToggle(); }); //banner $('.main-banner').owlCarousel({ slideSpeed: 300, paginationSpeed: 400, singleItem: true, autoPlay: true, pagination:true, autoplayHoverPause:true, }); //product-Tab $(".prdtnav .sel").hover(function(){ var liidx = $(this).index(); $(this).addClass("hoverNow").siblings(".sel").removeClass("hoverNow"); $(".prdtcase").eq(liidx).addClass("prdctnow").siblings(".prdtcase").removeClass("prdctnow"); }); $(".pic-biglunbo").owlCarousel({ slideSpeed: 300, paginationSpeed: 400, singleItem: true, autoPlay:false, pagination:true, navigation:true, autoplayHoverPause:true, }); //why choose $('.choose-banner').owlCarousel({ items: 4, itemsDesktop : [1199,2], itemsDesktopSmall : [900,2], itemsTablet: [600,1], itemsMobile : [479,1], }); //case $('.case-banner').owlCarousel({ items:3, itemsDesktop : [1000,3], itemsDesktopSmall : [900,2], itemsTablet: [600,1], itemsMobile : [479,1], }); //news $('.news-banner').owlCarousel({ slideSpeed: 300, paginationSpeed: 400, singleItem: true, autoPlay: false, pagination:false, navigation:true, }); $(".news-list .news-one").hover(function(){ var liidx = $(this).index(); $(this).addClass("active").siblings(".news-one").removeClass("active"); $(".news-bar").eq(liidx).addClass("active").siblings(".news-bar").removeClass("active"); }); //about // video $(".aboutPic img").click(function(){ $(".v3").slideToggle(); }); $(".aboutPic .closeddd").click(function(){ $(".v3").slideToggle(); }); //about $('.fcty-banner').owlCarousel({ items: 4, itemsDesktop : [1000,3], itemsDesktopSmall : [900,3], itemsTablet: [600,2], itemsMobile : [479,1], }); //product-show1 $('.led-banner').owlCarousel({ items: 5, }); //product-show2 $('.pdt-show-banner').owlCarousel({ items: 3, itemsDesktop : [1000,3], itemsDesktopSmall : [900,3], itemsTablet: [600,2], itemsMobile : [479,2], }); //abt-factory-bar $('.abt-factory-bar').owlCarousel({ slideSpeed: 300, paginationSpeed: 400, singleItem: true, autoPlay: false, pagination:false, navigation:true, }); $('.abt-factory-bar2').owlCarousel({ items:8, itemsDesktop : [1000,8], itemsDesktopSmall : [900,6], itemsTablet: [600,3], itemsMobile : [479,1], pagination:true, navigation:false, }); //aboout factory-banner var size =$(".abt-factory-bar2 .owl-item").size(); $(".abt-factory-bar2 .owl-item").click(function(e){ e.preventDefault(); $(".abt-factory-bar2 .owl-item .item").removeClass("active"); $(this).children(".item").addClass("active"); var i = $(this).index(); var w= parseFloat($(".abt-factory-bar2 .owl-item").css("width")); var x = $(this).parent(".owl-wrapper").css("transform").substring(7).split(','); if(i>=7&&i=4 && i=250){ $(".headers").addClass("headerFixed"); }else { $(".headers").removeClass("headerFixed"); } }); $(".pdt-show2 .pdt-txt .more").click(function(e){ e.preventDefault(); $("#askprice").show(); }); $("#askprice .sp1").click(function(e){ $("#askprice").hide(); }); }); window.onload = function () { $(".navbtn").click(function () { $(".nav1").slideToggle(); }); }