$(function () { $('.product-wall li').eq(0).addClass('active'); $('.in-customer .more').click(function () { var urls = $(this).data('src'); $(".video-area .title").html($(this).data('title')); $(".video-area .sub-title").html($(this).data('model')); $('#contentFrame').attr('src', urls); $(".video-area").show(); }); $(".video-area").click(function () { $('#contentFrame').attr('src', ''); $(this).hide(); }); }) /*轮播*/ new Swiper(".topSlider", { navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, pagination: { el: ".swiper-pagination", dynamicBullets: true, }, autoplay: { delay: 5000, disableOnInteraction: false, }, loop: true, }); /*底部标签云*/ tagcloud({ selector: ".tagcloud", fontsize: 16, radius: 100, mspeed: "normal", ispeed: "normal", direction: 135, keep: false, }); var swiper = new Swiper('#product_tagMobile', { slidesPerView: 3, spaceBetween:10, }); var winW = $(window).width(); if (winW < 900) { /*产品轮播*/ new Swiper(".partSlider", { slidesPerView: 1, pagination: { el: ".swiper-pagination", dynamicBullets: true, }, autoplay: { delay: 5000, disableOnInteraction: false, }, loop: true, }); /*客户轮播*/ new Swiper(".customerSlider", { pagination: { el: ".swiper-pagination", dynamicBullets: true, }, autoplay: { delay: 5000, disableOnInteraction: false, }, loop: true, }); /*客户轮播 视频*/ $('#contentFrame').css({ 'height': '300px' }); /*产品类型*/ $(".in-product-type li").hover(function () { $(".in-product-type li").removeClass("active"); $(this).addClass("active"); }); $(".in-product-type li a.img_a").bind("click", function (event) { return false;//阻止元素默认行为,比如点击链接会跳转 }); } else { /*产品轮播*/ new Swiper(".partSlider", { slidesPerView: 3, spaceBetween: 30, pagination: { el: ".swiper-pagination", dynamicBullets: true, }, autoplay: { delay: 5000, disableOnInteraction: false, }, loop: true, }); /*客户轮播*/ new Swiper(".customerSlider", { navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, autoplay: { delay: 5000, disableOnInteraction: false, }, loop: true, }); /*产品类型*/ $(".product-wall li").eq(0).css({ width: "50%" }); $(".in-product-type li").hover(function () { $(".in-product-type li").removeClass("active"); $(".in-product-type li").stop(!0).animate({ width: "12.5%" }, 200); $(this).addClass("active"); $(this).stop(!0).animate({ width: "50%" }, 200); }); }