//导航滑动
// $(window).scroll(function () {
// if ($(this).scrollTop() > 100) {
// $(".header").addClass('header-sticky');
// } else {
// $(".header").removeClass('header-sticky');
// }
// });
$(".module-banner-tab").slide({ trigger: "click", delayTime: 1000 });
/*=============================================================
Hover Effect
==============================================================*/
$(' .service-items .service-item,.project-carousel .project-item').each(function () {
$(this).hoverdir();
});
//锚点跳转
$(".com-anchors ul li a").click(function () {
var id = $(this).attr("class");
idid = id.substring(0, id.indexOf("shsh"));
var heihei1 = "." + idid + "dada";
$('html,body').animate({ scrollTop: $(heihei1).offset().top - $(".mt-header").height() - $(".com-ban .com-anchors").height() });
});
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$(".header").addClass('header-fixed-top');
} else {
$(".header").removeClass('header-fixed-top');
}
var headHeight = $(".com-ban").height() - $(".header").height();
if ($(window).scrollTop() > headHeight) {
$(".com-ban .com-anchors").addClass("fix");
$(".com-ban .com-anchors").css({ "top": $(".header").height(), "bottom": "auto" })
} else {
$(".com-ban .com-anchors").removeClass("fix");
$(".com-ban .com-anchors").css({ "top": "auto", "bottom": "0" })
}
});
var $tab_li = $('.tabs-team li');
$tab_li.click(function () {
$(this).addClass('active').siblings().removeClass('active');
var index = $tab_li.index(this);
$('.tab-content-wrap .tab-content').eq(index).show().siblings().hide();
});
var $tabnav_li = $('.mt-application .tabNav li');
$tabnav_li.click(function () {
$(this).addClass('active').siblings().removeClass('active');
var index = $tabnav_li.index(this);
$('.mt-application-field .tabPane').eq(index).show().siblings().hide();
});
// CONTENT TABS
// $('.tabs').each(function () {
// var $tabLis = $(this).find('li');
// var $tabContent = $(this).next('.tab-content-wrap').find('.tab-content');
// $tabContent.hide();
// $tabLis.first().addClass('active').show();
// $tabContent.first().show();
// });
// $('.tabs').on('click', 'li', function (e) {
// var $this = $(this);
// var parentUL = $this.parent();
// var tabContent = parentUL.next('.tab-content-wrap');
// parentUL.children().removeClass('active');
// $this.addClass('active');
// tabContent.find('.tab-content').hide();
// var showById = $($this.find('a').attr('href'));
// tabContent.find(showById).fadeIn();
// e.preventDefault();
// });
$('.category ul li').click(function () {
var i = $(this).index();
$(this).addClass('active').siblings().removeClass('active');
$('.content .cont').eq(i).addClass('active').siblings().removeClass('active');
})
//banner
// $(".mt-index-swiper").height($(window).height());
$(window).resize(function () {
// $(".mt-index-swiper").height($(window).height());
$(".mt-index-swiper .swiper-slide").each(function () {
$(this).find(".nei-wen").css({ "margin-top": -$(this).find(".nei-wen").height() / 2 })
});
$(".inde-jian .dfl .nei-wen").css({ "margin-top": -$(".inde-jian .dfl .nei-wen").height() / 2 })
});
var mySwiper = new Swiper('.mt-index-swiper', {
loop: true,
pagination: '.mt-index-swiper .pagination',
paginationClickable: true,
autoplayDisableOnInteraction: false,
autoplay: 6000,
speed: 10,
simulateTouch: false,
coverflowEffect: { // 切换效果的参数
rotate: 0,
stretch: 5,
depth: 60,
modifier: 2,
slideShadows: true
},
});
$('.mt-index-swiper .btnleft').on('click', function () {
mySwiper.swipePrev()
});
$('.mt-index-swiper .btnright').on('click', function () {
mySwiper.swipeNext()
});
$('.dowebok').liMarquee({
direction: 'left'
});
//推荐案例
var mySwiper2 = new Swiper('.swiper-container.swiper-case', {
pagination: '.mt-swiper-case .pagination',
loop: true,
grabCursor: true,
paginationClickable: true
})
$('.mt-swiper-case .arrow-left').on('click', function (e) {
e.preventDefault()
mySwiper2.swipePrev()
})
$('.mt-swiper-case .arrow-right').on('click', function (e) {
e.preventDefault()
mySwiper2.swipeNext()
})
//成功案例
var swiperproject = new Swiper('.swiper-container.mt-index-project', {
pagination: '.mt-swiper-project .pagination',
loop: true,
grabCursor: true,
paginationClickable: true
});
$('.mt-swiper-project .arrow-left').on('click', function (e) {
e.preventDefault()
swiperproject.swipePrev()
})
$('.mt-swiper-project .arrow-right').on('click', function (e) {
e.preventDefault()
swiperproject.swipeNext()
})
// wap导航按钮
$(".p-click-alert").click(function () {
$('.p-click-alert').stop().toggleClass("zhuan");
$(".header .head-nav").stop().slideToggle(400)
});
// 产品tab切换
$('.product-tab li').click(function () {
$(this).addClass('active').siblings().removeClass('active');
var index = $('.product-tab li').index(this);
$('div.product-list .product-item').eq(index).show().siblings().hide();
});
$('.swiper-tabs .tabs').tabslet({
active: 1, //第几个选项卡开始
autorotate: false, //设置自动切换效果
delay: 12000, //设置切换时间
animation: true, //设置过渡效果
controls: { //设置左右按钮控制选项卡切换
prev: '.prev',
next: '.next'
}
});
/*=============================================================
Project Carousel
==============================================================*/
$('.project-carousel').slick({
dots: true,
infinite: false,
speed: 300,
slidesToShow: 4,
slidesToScroll: 1,
prevArrow: '',
nextArrow: '',
infinite: true,
dots: true,
pauseOnFocus: false,
pauseOnHover: true,
responsive: [{
breakpoint: 1024,
settings: {
slidesToShow: 3,
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 2,
}
},
{
breakpoint: 580,
settings: {
slidesToShow: 1,
}
}
]
});
/*=============================================================
Project Carousel
==============================================================*/
$('.honor-carousel').slick({
dots: true,
infinite: false,
speed: 300,
slidesToShow: 4,
slidesToScroll: 1,
prevArrow: '',
nextArrow: '',
infinite: true,
dots: true,
pauseOnFocus: false,
pauseOnHover: true,
responsive: [{
breakpoint: 1024,
settings: {
slidesToShow: 3,
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 2,
}
},
{
breakpoint: 580,
settings: {
slidesToShow: 1,
}
}
]
});
/*=============================================================
Sponsor Carousel
==============================================================*/
$('.sponsor-carousel').slick({
speed: 300,
slidesToShow: 5,
slidesToScroll: 1,
autoplay: true,
infinite: true,
dots: false,
arrows: true,
prevArrow: '',
nextArrow: '',
loop: true,
pauseOnFocus: false,
pauseOnHover: true,
responsive: [{
breakpoint: 1024,
settings: {
slidesToShow: 4,
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 4,
}
},
{
breakpoint: 580,
settings: {
slidesToShow: 3,
}
}
]
});
$('.rongyu-carousel').slick({
speed: 300,
slidesToShow: 4,
slidesToScroll: 1,
autoplay: true,
infinite: true,
dots: false,
arrows: true,
prevArrow: '',
nextArrow: '',
loop: true,
pauseOnFocus: false,
pauseOnHover: true,
responsive: [{
breakpoint: 1024,
settings: {
slidesToShow: 4,
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 4,
}
},
{
breakpoint: 580,
settings: {
slidesToShow: 3,
}
}
]
});
/*=============================================================
Project Carousel
==============================================================*/
$('.application-carousel').slick({
infinite: false,
speed: 300,
slidesToScroll: 1,
autoplay: true,
slidesToShow: 1,
slidesToScroll: 1,
prevArrow: '',
nextArrow: '',
infinite: true,
dots: false,
pauseOnFocus: false,
pauseOnHover: true,
responsive: [{
breakpoint: 1024,
settings: {
slidesToShow: 3,
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 2,
}
},
{
breakpoint: 580,
settings: {
slidesToShow: 1,
}
}
]
});
/*=============================================================
Scroll to Top
==============================================================*/
var scrollTop = $("#scroll-top");
$(window).on('scroll', function () {
var topPos = $(this).scrollTop();
if (topPos > 100) {
$('#scrollup').removeClass('hide');
$('#scrollup').addClass('show');
} else {
$('#scrollup').removeClass('show');
$('#scrollup').addClass('hide');
}
});
$(scrollTop).on("click", function () {
$('html, body').animate({
scrollTop: 0
}, 800);
return false;
});
$('.timer').countTo();
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: true,
live: true
});
wow.init();
function setContentSize() {
$('.swiper-content').css({
height: $(window).height() - $('.swiper-nav').height()
})
}
setContentSize()
$(window).resize(function () {
setContentSize()
})
//Swiper Content
var contentSwiper = $('.swiper-content').swiper({
onSlideChangeStart: function () {
updateNavPosition()
}
})
//Nav
var navSwiper = $('.swiper-nav').swiper({
visibilityFullFit: true,
slidesPerView: 'auto',
//Thumbnails Clicks
onSlideClick: function () {
contentSwiper.swipeTo(navSwiper.clickedSlideIndex)
}
})
//console.log("\u767e\u5ea6\u641c\u7d22\u3010\u7d20\u6750\u5bb6\u56ed\u3011\u4e0b\u8f7d\u66f4\u591aJS\u7279\u6548\u4ee3\u7801");
//Update Nav Position
function updateNavPosition() {
$('.swiper-nav .active-nav').removeClass('active-nav')
var activeNav = $('.swiper-nav .swiper-slide').eq(contentSwiper.activeIndex).addClass('active-nav')
if (!activeNav.hasClass('swiper-slide-visible')) {
if (activeNav.index() > navSwiper.activeIndex) {
var thumbsPerNav = Math.floor(navSwiper.width / activeNav.width()) - 1
navSwiper.swipeTo(activeNav.index() - thumbsPerNav)
}
else {
navSwiper.swipeTo(activeNav.index())
}
}
}
$(window).on('scroll', function () {
countUp();
});
/*-------------------------
COUNT UP
-------------------------*/
function countUp() {
"use strict";
var scroll = $(window).scrollTop();
var countId = $('#count-up');
if (countId.length) {
var winH = $(window).height(),
countOffset = countId.offset().top;
if (scroll + winH > countOffset) {
$('.timer').countTo();
$('.odometer').removeClass('timer');
}
}
}