$('.nav_list li').click(function () { $(this).addclass('select').siblings().removeclass('select'); var i = $(this).index(); $('.partner_fr .cont').eq(i).addclass('show').siblings().removeclass('show'); }); $('.container .question li').click(function () { $(this).addclass('active').siblings().removeclass('active'); var i = $(this).index(); $('.container .question li .bt_txt').eq().addclass('show').siblings().removeclass('show'); }); $('.container .aftersale li').click(function () { $(this).addclass('active').siblings().removeclass('active'); var i = $(this).index(); $('.container .aftersale_cont').eq(i).addclass('show').siblings().removeclass('show'); }); $(window).scroll(function () { var scrollt = document.documentelement.scrolltop || document.body.scrolltop; if (window.innerwidth > 1000) { if (scrollt > 0) { $("#globalnav").addclass("scroll"); } else { $("#globalnav").removeclass("scroll"); } } }); $(function () { var swiper = new swiper('#news', { pagination: '.swiper-pagination', slidesperview: 1, paginationclickable: true, loop: true, autoplay: 2500, }); }); $('#to_top').hide(); $(function () { $(window).scroll(function () { if ($(window).scrolltop() > 300) { $('#to_top').fadein(300); } else { $('#to_top').fadeout(200); } }); $('#to_top').click(function () { $('body,html').animate({ scrolltop: 0 }, 300); return false; }) }) /* window.onload = function () { $(".dropdown a").each(function () { var $str = "项目交付"; if ($str.indexof($(this).text()) > -1) { $(this).attr("target", "_blank"); } }); $(".tarra").each(function () { var $stwr = "项目交付"; if ($stwr.indexof($(this).html()) > -1) { $(this).attr("taget", "_blank"); } }); $("#qhcon .sing_cont").each(function () { var $tarid = $(this).parent().attr("id"); if ($(this).html() == null || $(this).html() == "") { $("." + $tarid + "").hide(); } }); }*/ $(".pro_detail .mod2 ul li").click(function () { $(this).addclass('active').siblings().removeclass('active'); var i = $(this).index(); $('.pro_detail .article>div ').eq(i).addclass('show').siblings().removeclass('show'); if ($(".pro_detail .article>div").css("dispalay", "none")) { $(this).css("dispalay", "none"); } }) $('.video_pic').click(function (e) { e.stoppropagation(); //阻止冒泡 $(".contain_bg").css("display", "block") }); $(document).click(function () { if ($('.contain_bg').css("display", "block")) { $('.contain_bg').css("display", "none"); } }); $('.contain_bg video').click(function (e) { e.stoppropagation(); //阻止冒泡 });