$(function(){ $('.hbanner .ul_img').slick({ dots: true, speed: 500, arrows: true, infinite: false, fade: true, autoplay: true, asnavfor: '.hbanner .ul_txt', appendarrows:'.hbanner .btn', }); $('.hbanner .ul_txt').slick({ dots: false, slidestoshow: 3, slidestoscroll: 1, speed: 500, arrows: false, infinite: false, autoplay: true, asnavfor: '.hbanner .ul_img', focusonselect: true, vertical: true, }); $(".hbanner .other li").mouseover(function(){ $(this).find("figure").stop(true,true).fadein(500); }); $(".hbanner .other li").mouseout(function(){ $(this).find("figure").stop(true,true).fadeout(500); }); $('.habout .pic_carousel ul').slick({ dots: false, speed: 500, arrows: true, infinite: false, fade: true, autoplay: true, }); $(".hpro .tab_switch ul").slick({ dots: false, infinite: false, speed: 300, arrows: true, slidestoshow: 6, responsive: [ { breakpoint: 1024, settings: { slidestoshow: 4 } }, { breakpoint: 648, settings: { slidestoshow: 3 } }, { breakpoint: 480, settings: { slidestoshow: 2 } } ] }); function productshow(e){ var _this=$(".hpro .tab_list .list").eq(e).find(".pro_show .ul"); if(_this.hasclass("slick-slider")){ _this.slick('unslick'); } _this.slick({ dots: false, infinite: false, speed: 300, arrows: true, slidestoshow: 3, responsive: [ { breakpoint: 648, settings: { slidestoshow: 2 } } ] }); } $(".hpro .switch").mouseover(function(){ var index=$(this).index(); $(this).addclass("switch_aon"); $(this).removeclass("next prev"); $(this).siblings().removeclass("switch_aon next prev show"); $(this).prev().addclass("prev"); $(this).next().addclass("next"); $(".hpro .tab_list .list").hide(); $(".hpro .tab_list .list").eq(index).siblings().find(".pro_show").removeclass("pro_show_on"); $(".hpro .tab_list .list").eq(index).show(); productshow($(this).index()); }); $(".hpro .switch").eq(0).addclass("switch_aon"); $(".hpro .tab_list .list").eq(0).show(); $(".hpro .switch").click(function(){ //console.log($(this).index()) $(this).toggleclass("show") if($(this).hasclass("show")){ $(".hpro .tab_list .list").eq($(this).index()).find(".pro_show").addclass("pro_show_on"); productshow($(this).index()); }else{ $(".hpro .tab_list .list").eq($(this).index()).find(".pro_show").removeclass("pro_show_on"); } }) $(window).on("resize", function(e) { var w_certifi = $(window).width() if (w_certifi <= 768) { productshow(0); } }).trigger("resize"); $(".hnews .ul").slick({ dots: false, infinite: false, speed: 300, arrows: true, slidestoshow: 3, responsive: [ { breakpoint: 769, settings: { slidestoshow: 2 } }, { breakpoint: 640, settings: { slidestoshow: 1 } } ] }); $('.video_bn').click(function() { $('#video').attr("src", $(this).attr("data-src")); $('#video_play_wrap').fadein(function() { $('#video')[0].play(); }); }); $('#video_play_wrap .close-btn').click(function() { $('#video_play_wrap').fadeout(function() { $('#video')[0].pause(); var videosrc = $('#video')[0].currentsrc; $('#video').src = ''; $('#video').src = videosrc; }) }); })