//////////////////////////////
$(".ind_banner").slick({
    autoplay:true,
    speed: 1200,
    dots: true,
    arrows: true,   
});


$(".ind_product .product").slick({
	autoplay:true,
	fade: true,
	speed: 1200,
	dots: true,
	arrows: false, 
	customPaging: function (slider, i) {
		var small = $("div[data-slick-index='" + i + "']").find(".small").html()
		return $('<div  class="small" />').html(small);
	},
});

//$(".ind_product .slick-dots li .small").mouseover(function(){
//	$(this).parent().click()
//})
$(".ind_product .slick-dots li .small").mouseover(function(){
	var _this=$(".ind_product")
	var index = $(this).parent().index();	
	_this.find(".slick-dots li").removeClass("slick-active");
	$(this).parent("li").addClass("slick-active");
	_this.find(".item").css({"opacity":0,"z-index":998});
	_this.find(".item").eq(index).css({"opacity":1,"z-index":999});
    _this.find(".item").removeClass("slick-current slick-active")
	_this.find(".item").eq(index).addClass("slick-current slick-active")
});

$('.ind_news .list').slick({
  dots: false,
  infinite: false,
  speed: 300,
  slidesToShow: 3,
  slidesToScroll: 3,
  responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2
      }
    },
    {
      breakpoint: 640,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1
      }
    }

  ]
});
/////////////////////
$('.honor_photo').slick({
  dots: true,
  infinite: false,
  speed: 300,
  slidesToShow: 4,
  slidesToScroll: 4,
  responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 3,
        slidesToScroll: 3,
        infinite: true,
        dots: true
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2
      }
    },
  ]
});

/////////////////
  
$(".video_play").click(function(){
    //先清除其他
    $(".video_files").remove();
    //
    var video_file=$(this).attr("data-video");
    $(this).parent().prepend('<div class="video_files"><span class="close"></span><video controls=""  id="video_id"  src="'+video_file+'" autoplay></video></div>');
    var audio = document.getElementById('video_id');
    audio.play();


    //关闭视频播放器
    $(".video_files .close").click(function(){
        $(".video_files").remove();
    });
})

$(".brand_product_video").each(function () {
    if ($.trim($(this).html()) == "") {
        $(this).remove();
    }
});
