$(function () { //团队 $(".team_ul li").click(function (e) { e.stopPropagation() e.preventDefault() var index=$(this).index() var url = $(this).data("src"); if (url == "") { return false; } else { teamAjax(".team_box_details", url); setTimeout(function(){ $(".team_box").stop().fadeIn().show(); teamSwiper(index) },200) } setTimeout(function () { var oddHeight = Math.ceil($(".team_c").outerHeight(true)) if (oddHeight % 2 == 0) { $(".team_c").removeClass("current") } else { $(".team_c").addClass("current") } }, 200) }) $(document).on("click",".team_box .mask,.team_box .video_close",function(){ $(".team_box").fadeOut(); $(".team_box_details").html("") }) }) function teamSwiper(index) { var teamSwiper = new Swiper('.team_box_con .swiper-container',{ pagination : '.team_box_con .swiper-pagination', paginationClickable: true, slidesPerView:1, spaceBetween:0, nextButton:'.team_box_con .swiper-button-next', prevButton:'.team_box_con .swiper-button-prev', }) teamSwiper.slideTo(index,0) } function teamAjax(str, url) { if (url.indexOf('?') == -1) { url += '?tm=' + Math.random(); } else { url += '&tm=' + Math.random(); } $.ajax({ url: url, success: function (msg) { $(str).html(""); $(str).append(msg); ScollText(".team_p") } }); }