$(function(){ index_animate(); if($(window).width()>767){ ScollText02(".scoll_text"); } ScollText02(".his_box"); hisslider(); newslider(); share(); recruitSlider(); purchase_slder01(); purchase_slder02(); clinical(); }) function purchase_slder01(){ if($(".purchase_slder01 li").length>1){ var mySwiper = new Swiper('.purchase_slder01 .swiper-container',{ loop:false, slidesPerView:3, loopAdditionalSlides:100, spaceBetween: 30, autoplayDisableOnInteraction : false, pagination : '.purchase_slder01 .swiper-pagination', paginationClickable :true, prevButton:'.purchase_slder01 .swiper-button-prev', nextButton:'.purchase_slder01 .swiper-button-next', breakpoints:{ 1440: { spaceBetween: 20, }, 767: { slidesPerView:1, spaceBetween:0, }, } }) } if($(".purchase_slder01 li").length>3){ $(".purchase_slder01 .swiper-pagination").show(); } if($(window).width()<=767){ if($(".purchase_slder01 li").length>1){ $(".purchase_slder01 .but_div").show(); } } } function purchase_slder02(){ if($(".purchase_slder02 li").length>1){ var mySwiper = new Swiper('.purchase_slder02 .swiper-container',{ loop:false, slidesPerView:3, loopAdditionalSlides:100, spaceBetween: 30, autoplayDisableOnInteraction : false, pagination : '.purchase_slder02 .swiper-pagination', paginationClickable :true, prevButton:'.purchase_slder02 .swiper-button-prev', nextButton:'.purchase_slder02 .swiper-button-next', breakpoints:{ 1440: { spaceBetween: 20, }, 767: { slidesPerView:1, spaceBetween:0, }, } }) } if($(".purchase_slder02 li").length>3){ $(".purchase_slder02 .but_div").show(); } } function recruitSlider(){ if($("html").hasClass("ie9")){ // if($(".ie9 .recruit_slider li").length>1){ // var mySwiper = new Swiper('.ie9 .recruit_slider .swiper-container',{ // loop:false, // slidesPerView: 3, // loopAdditionalSlides:100, // spaceBetween: 20, // autoplayDisableOnInteraction : false, // pagination : '.ie9 .recruit_slider .swiper-pagination', // paginationClickable :true, // prevButton:'.ie9 .recruit_slider .swiper-button-prev', // nextButton:'.ie9 .recruit_slider .swiper-button-next', // }) // } }else{ if($(".recruit_slider li").length>2){ var mySwiper = new Swiper('.recruit_slider .swiper-container',{ loop:true, autoplay:3000, speed:1000, slidesPerView: "auto", centeredSlides:true, loopAdditionalSlides:100, spaceBetween: 0, autoplayDisableOnInteraction : false, pagination : '.recruit_slider .swiper-pagination', paginationClickable :true, prevButton:'.recruit_slider .swiper-button-prev', nextButton:'.recruit_slider .swiper-button-next', }) } } if($(".ie9 .recruit_slider li").length>1){ if($(".ie9 .recruit_slider li").length>2){ $(".ie9 .recruit_slider .swiper-pagination").show(); }else{ $(".ie9 .recruit_slider .swiper-pagination").hide(); } var mySwiper = new Swiper('.ie9 .recruit_slider .swiper-container',{ loop:true, slidesPerView: 3, loopAdditionalSlides:100, spaceBetween: 20, autoplayDisableOnInteraction : false, pagination : '.ie9 .recruit_slider .swiper-pagination', paginationClickable :true, prevButton:'.ie9 .recruit_slider .swiper-button-prev', nextButton:'.ie9 .recruit_slider .swiper-button-next', }) } } function newslider(){ if($(".news_top .swiper-slide").length>1){ var brand3Swiper = new Swiper('.news_top .swiper-container', { slidesPerView: 1, slidesPerGroup: 1, autoplay:5000, loop:true, speed:1000, paginationClickable: true, autoplayDisableOnInteraction : false, spaceBetween: 0, prevButton:'.news_top .swiper-button-prev', nextButton:'.news_top .swiper-button-next', }) $(".but_div,.but_div02").show(); } } function hisslider(){ if($(window).width()<=1024){ if($(".history_list li").length>1){ var brand3Swiper = new Swiper('.history_list .swiper-container', { slidesPerView: 1, slidesPerGroup: 1, spaceBetween: 0, prevButton:'.history_list .swiper-button-prev', nextButton:'.history_list .swiper-button-next', }) } } } function index_animate(){ $(".history_list li").eq(0).addClass("on"); $(".history_list li").hover(function(){ $(this).addClass("on").siblings().removeClass("on") }) if ($('.history_list li').length>0) { $('.history_list li').each(function(index, el) { var target=$(this); target.mouseover(function(event) { var index=target.index(); $('.history_list').attr('class','history_list state_'+(index+1)); }); }); } } function ScollText02(obj){ if($(obj).length>0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } } function imgratio2() {//图片 ratio方法调用 $(".ratio-img2").each(function (index, element) { if($(this).is(":visible")) { $(this).css({minHeight:Math.floor($(this).width()*$(this).data("ratio"))}); } }); } $(function () { imgratio2()//初始化图片ratio setTimeout(function () { imgratio2() }, 100) $(".ratio-img2").each(function (index, element) { $(this).attr({ "src": $(this).data("src") });//图片预加载 }); //窗口改变大小回调ratio; var rtime = new Date(); var timeout = false; var delta = 200; $(window).resize(function () { rtime = new Date(); if (timeout === false) { timeout = true; setTimeout(resizeend, delta); //resize只回调最后一次 } }); function resizeend() { //window.resize回调 if (new Date() - rtime < delta) { setTimeout(resizeend, delta); } else { timeout = false; imgratio2()//ratio } } // }) //--------------点击分享 function share(){ $(".share_facebook").click(function () {//Facebook var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.facebook.com/sharer.php?s=100&p[title]=" + title + "&p[summary]=!&p[url]=" + encodeURIComponent(url) + "" window.open(op) }) $(".share_twitter").click(function () {//Twitter var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.tumblr.com/login?redirect_to=https://www.tumblr.com/widgets/share/tool?shareSource=legacy&canonicalUrl=&url=" + encodeURIComponent(url) + "&title=" + title + ""; window.open(op) }) $(".share_wb").click(function () {//微博 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://service.weibo.com/share/share.php?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op) }) $(".share_qqkj").click(function () {//腾讯微博 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op) }) $(".share_qq").click(function () {//QQ var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://connect.qq.com/widget/shareqq/index.html?url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_douban").click(function () {//豆瓣 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.douban.com/share/service?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_bd").click(function () {//百度贴吧 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://s.share.baidu.com/mshare?url=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) //微信 $(".share_wx").attr("data-qrcode","http://www.xinhongru.com/qrcode/qrcode.php?content="+window.location.href); $(".share_wx").click(function () {//微信 //var url = "/qrCode/Index.aspx?url=" + window.location.href; var url = $(this).attr("data-qrcode") console.log(url) var title = "" title += "
" title += "x" title += "

二维码

" title += "
" title += "

扫一扫

" title += "
" $("body").remove(".weixin"); $("body").append(title) }) $(document).on("click", ".weixin .c", function () { $(".weixin").remove(); }) } function clinical(){ if($(".his_ll li").length>3){ $(".but_pagination03").show(); } if($(".his_ll li").length>1){ $(".his_but").show(); } var his_slide = new Swiper('.history-part .swiper-container',{ direction: 'vertical', slidesPerView: 3, slidesPerGroup : 1, spaceBetween: 6, prevButton:'.history-part .swiper-button-prev', nextButton:'.history-part .swiper-button-next', pagination: '.history-part .swiper-pagination', paginationClickable :true, autoplayDisableOnInteraction : false, noSwiping : true, breakpoints:{ 767: { direction: 'horizontal', noSwiping : false, } } }) $(".history-part .but_pagination03 span").click(function(){ console.log(1) setTimeout(function(){ $(".his_ll .swiper-slide-active").click(); },200) }) var _ind=0; var _len = $(".history-part .swiper-slide").length; //console.log(_len); btnJudge(); $(".history-part .swiper-slide").click(function(){ _ind = $(this).index(); btnJudge(); var url = $(this).data("src"); $(this).addClass("on").siblings().removeClass("on"); var imgesrc = $(this).find("img").attr("src"); var title = $(this).find("h3").text(); $(".his_img img").attr("src",imgesrc); $(".his_img h3").text(title); }) $(".history-part .swiper-button-prev").click(function(){ _ind--; btnJudge(); $(".history-part .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".history-part .swiper-slide.on").click(); }) $(".history-part .swiper-button-next").click(function(){ _ind++; btnJudge(); $(".history-part .swiper-slide").eq(_ind).addClass("on").siblings().removeClass("on"); $(".history-part .swiper-slide.on").click(); }) $(".history-part .swiper-slide:eq(0)").click(); function btnJudge() { if(_ind >= _len - 1) { $('.history-part .swiper-button-next').addClass("disabled") _ind = _len - 1; } else { $('.history-part .swiper-button-next').removeClass("disabled") } if(_ind <= 0) { $(".history-part .swiper-button-prev").addClass("disabled") _ind = 0; } else { $(".history-part .swiper-button-prev").removeClass("disabled") } } } $(function(){ $(".vide0_close").click(function() { $("body").removeClass("lightbox-noscrol"); $(this).parents(".video_appbox").removeClass("show") $(".video_t").html("") }); var srcl="",simg=''; //楂樺害璁$畻 $(".video_button").click(function(e){ $("body").addClass("lightbox-noscrol"); srcl=$(this).data("video"); simg=$(this).data("img"); $(".video_appbox").addClass("show") video(); }) $(".video_appbox .mask").click(function(){ $("body").removeClass("lightbox-noscrol"); $(".video_appbox").removeClass("show") $(".video_t").html("") }) function video(){ $(".video_t").html("") $(".video_t video").attr({width:$(".video_t").width(),height:$(".video_t").height()}) } })