$(function () {
function rem() {
!function (n) {
var e = n.document,
t = e.documentElement,
i = 768,
d = i / 100,
o = "orientationchange" in n ? "orientationchange" : "resize",
a = function () {
if ($(window).innerWidth() > 768) {
$('html').removeAttr('style');
} else {
var n = t.clientWidth || 320; n > 768 && (n = 768);
t.style.fontSize = n / d + "px"
}
};
e.addEventListener && (n.addEventListener(o, a, !1), e.addEventListener("DOMContentLoaded", a, !1))
}(window);
}
rem();
// 防抖方法
function AntiShake(fn, wait) {
var timer = null;
return function () {
if (timer !== null) {
clearTimeout(timer);
}
timer = setTimeout(fn, wait);
};
}
AntiShake(onResize, 200);
$(window).resize(AntiShake(onResize, 100));
AntiShake(onScroll, 200);
$(window).scroll(AntiShake(onScroll, 100));
//wow调用
if (typeof WOW != 'undefined') {
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: true,
live: true
});
wow.init();
}
//弹出视频播放器
$('.videoBtn').on('click', function () {
var url = $(this).attr('rel');
if (url.indexOf('http') == 0) {
$('.videoPlayer').html('');
} else {
$('.videoPlayer').html('');
}
$('.PopupVideoBox').fadeIn(200);
});
//关闭弹出播放器
$('.closeVideo').on('click', function () {
$('.PopupVideoBox').fadeOut(200);
$('.videoPlayer').html('');
});
//swiper方法调用
if (typeof Swiper != 'undefined') {
//tyc122cc太阳成集团banner
var defaBanner = new Swiper('.defaBanner', {
paginationClickable: true,
loop: true,
autoplay: 4500,
autoplayDisableOnInteraction: false,
nextButton: '.defaBannerNext',
prevButton: '.defaBannerPrev',
pagination: '.defaBannerdot',
onInit: function (swiper) {
},
onTransitionEnd: function (swiper) {
}
});
//二级栏目适应内容区
var defaSecondLevelColumn = new Swiper('.defaSecondLevelColumn', {
paginationClickable: true,
slidesPerView: "auto",
spaceBetween: 0,
autoplayDisableOnInteraction: false,
});
}
// 页面监听窗口
function onResize() {
if ($(window).innerWidth() > 1259) {
$('html').removeClass('hideScroll');
$('.defaSearch span').removeClass('closeSearchbox');
$('.defanav ul li p, .defanav, .defaSearchbox,.defaLanguage p').removeAttr('style');
}
}
//滚动条监听
function onScroll() {
var scrollTop = $(window).scrollTop();
if (scrollTop > $('.header').height()) {
$('.defaheader').addClass('defaheaderbg');
} else {
$('.defaheader').removeClass('defaheaderbg');
}
}
//其他事件
$('.defaheader').hover(function () {
$(this).addClass('defaheaderbg');
}, function () {
if ($(window).scrollTop() < $('.defaheader').height()) {
$(this).removeClass('defaheaderbg');
}
});
$('.defanav ul li i').on('click', function () {
if ($(this).next().is(':hidden')) {
$(this).parent().siblings().find('p').slideUp(200);
$(this).parent().siblings().removeClass('cur');
$(this).next().slideDown(200);
$(this).parent().addClass('cur');
} else {
$(this).next().slideUp(200);
$(this).parent().removeClass('cur');
}
});
$('.defanavbtn').on('click', function () {
if ($('.defanav').is(':hidden')) {
$(this).addClass('defacloseNavbtn');
$('.defanav').slideDown(200);
$('html').addClass('hideScroll');
$('.defaSearchbox').hide();
$('.defaSearch span').removeClass('closeSearchbox');
$('.defaLanguage p').hide();
} else {
$(this).removeClass('defacloseNavbtn');
$('.defanav').slideUp(200);
$('html').removeClass('hideScroll');
}
});
$('.defaSearch span').on('click', function () {
if (window.innerWidth < 1260) {
if ($(this).next().is(':hidden')) {
$(this).addClass('closeSearchbox');
$(this).next().slideDown(200);
$('.defanav').hide();
$('.defanavbtn').removeClass('defacloseNavbtn');
$('.defaLanguage p').hide();
} else {
$(this).removeClass('closeSearchbox');
$(this).next().slideUp(200);
}
}
});
$('.defaLanguage span').on('click', function () {
if (window.innerWidth < 1260) {
if ($(this).next().is(':hidden')) {
$(this).addClass('closeSearchbox');
$(this).next().slideDown(200);
$('.defanav').hide();
$('.defanavbtn').removeClass('defacloseNavbtn');
$('.defaSearchbox').hide();
$('.defaSearch span').removeClass('closeSearchbox');
} else {
$(this).removeClass('closeSearchbox');
$(this).next().slideUp(200);
}
}
});
if ($("#grid").length > 0) {
int();
function int() {
new AnimOnScroll(document.getElementById('grid'), {
minDuration: 0.4,
maxDuration: 0.7,
viewportFactor: 0.2
});
}
$('.WaterfallFlowMore').on('click', function () {
var html = '

2020.10.13
1从路人甲到C位咖,完美就要这么“妆”!
作为社会人,每个人都要与他人往来和接触,总有见一面的时候,总会产生或好或坏的第一印象,就第一印象而言,谁都只有一次机会...

2020.10.13
2从路人甲到C位咖,完美就要这么“妆”!
作为社会人,每个人都要与他人往来和接触,总有见一面的时候,总会产生或好或坏的第一印象,就第一印象而言,谁都只有一次机会...
';
$('.WaterfallFlow ul').append(html);
int();
});
}
//返回顶部
$('.go_top').click(function () {
$('html, body').stop(true, true).animate({
scrollTop: 0
}, 500);
});
// fadeIn动画
scrollTop('.animate_fadeLeft200', 'fadeInLeft200');
scrollTop('.animate_fadeLeft150', 'fadeInLeft150');
scrollTop('.animate_fadeLeft100', 'fadeInLeft100');
scrollTop('.animate_fadeLeft80', 'fadeInLeft80');
scrollTop('.animate_fadeLeft50', 'fadeInLeft50');
scrollTop('.animate_fadeLeft30', 'fadeInLeft30');
scrollTop('.animate_fadeLeft20', 'fadeInLeft20');
scrollTop('.animate_fadeLeft10', 'fadeInLeft10');
scrollTop('.animate_fadeRight200', 'fadeInRight200');
scrollTop('.animate_fadeRight150', 'fadeInRight150');
scrollTop('.animate_fadeRight100', 'fadeInRight100');
scrollTop('.animate_fadeRight80', 'fadeInRight80');
scrollTop('.animate_fadeRight50', 'fadeInRight50');
scrollTop('.animate_fadeRight30', 'fadeInRight30');
scrollTop('.animate_fadeRight20', 'fadeInRight20');
scrollTop('.animate_fadeRight10', 'fadeInRight10');
scrollTop('.animate_fadeUp200', 'fadeInUp200');
scrollTop('.animate_fadeUp150', 'fadeInUp150');
scrollTop('.animate_fadeUp100', 'fadeInUp100');
scrollTop('.animate_fadeUp80', 'fadeInUp80');
scrollTop('.animate_fadeUp50', 'fadeInUp50');
scrollTop('.animate_fadeUp30', 'fadeInUp30');
scrollTop('.animate_fadeUp20', 'fadeInUp20');
scrollTop('.animate_fadeUp10', 'fadeInUp10');
scrollTop('.animate_fadeDown200', 'fadeInDown200');
scrollTop('.animate_fadeDown150', 'fadeInDown150');
scrollTop('.animate_fadeDown100', 'fadeInDown100');
scrollTop('.animate_fadeDown80', 'fadeInDown80');
scrollTop('.animate_fadeDown50', 'fadeInDown50');
scrollTop('.animate_fadeDown30', 'fadeInDown30');
scrollTop('.animate_fadeDown20', 'fadeInDown20');
scrollTop('.animate_fadeDown10', 'fadeInDown10');
scrollTop('.animate_fadeWidth100', 'fadeInWidth100');
scrollTop('.animate_fadeIn', 'fadeIn');
scrollTop('.animate_open', 'open');
});
/* 添加动画 */
function scrollTop(el, classN, callback) {
var $el = $(el);
var callbackFlag = 0;
var winW = $(window).width();
var space = 200;
if (winW <= 768) {
space = 20;
}
$el.each(function (i, elE) {
var elH = Math.ceil($(elE).offset().top) + space;
var winH = $(window).height();
var winScr = $(window).scrollTop();
if (elH < winH + winScr) {
$(elE).addClass(classN);
if (callback && callbackFlag == 0) {
callback();
callbackFlag++;
}
}
$(window).scroll(function () {
elH = Math.ceil($(elE).offset().top) + space;
winScr = $(window).scrollTop();
if (elH < winH + winScr) {
$(elE).addClass(classN);
if (callback && callbackFlag == 0) {
callback();
callbackFlag++;
}
}
/* elE.addEventListener("webkitAnimationEnd", function () {
$(elE).removeClass(function (index, css) {
return (css.match(/(^|\s)animate_\S+/g) || []).join('');
});
}) */
})
})
}
$(function () {
var banner = new Swiper('.banner .swiper-container', {
paginationClickable: true,
autoplay: 3000,
parallax: true,
speed: 300,
pagination: '.banner .swiper-pagination',
});
var main2 = new Swiper('.main2 .swiper-container', {
paginationClickable: true,
autoplay: 3000,
parallax: true,
speed: 300,
spaceBetween: 17,
slidesPerView: 4,
pagination: '.main2 .swiper-pagination',
breakpointsInverse: true,
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
breakpoints:{
414:{
slidesPerView: 1,
spaceBetween: 20
},
768:{
slidesPerView: 2,
spaceBetween: 20
},
1200:{
slidesPerView: 3,
spaceBetween: 70
}
}
});
new Swiper('.technology1 .main3_swiper', {
spaceBetween: 20,
slidesPerView: 4,
loop: true,
prevButton: '.technology1 .main3 .swiper-button-prev',
nextButton: '.technology1 .main3 .swiper-button-next',
breakpoints: {
480: {
slidesPerView: 2
},
//当宽度小于等于640
768: {
slidesPerView: 2
}
}
})
function AntiShake(fn, wait) {
var timer = null;
return function () {
if (timer !== null) {
clearTimeout(timer);
}
timer = setTimeout(fn, wait);
};
}
function onResize() {
if (window.innerWidth > 991) {
$('html').removeClass('hideScroll');
$('.nav').removeAttr('style');
}
}
$(window).resize(AntiShake(onResize, 200));
if (typeof WOW != 'undefined') {
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: false,
live: true
});
wow.init();
}
if ($(window).width() > 1200) {
$(".nav ul li").mouseover(function () {
$(this).children(".t").stop().slideDown();
});
$(".nav ul li").mouseleave(function () {
$(this).children(".t").stop().slideUp();
});
} else {
$(".nav ul li").click(function () {
$(this).toggleClass("active").siblings().removeClass("active");
$(this).children(".t").stop().slideToggle()();
});
}
$(window).scroll(function () {
// console.log($(window).scrollTop(),'$(window).scrollTop')
// if($(window).scrollTop() > 200){
// $('.siade').fadeIn();
// }else{
// $('.siade').fadeOut();
// }
$('.head_dropdown').removeClass('active')
$('.header .head_bottom .line').removeClass('hover');
})
$('.header .head_top .language').hover(function () {
$('.header .head_top .language .down').stop().slideDown();
}, function () {
$('.header .head_top .language .down').stop().slideUp();
})
$('.header .head_bottom .line').hover(function () {
if (!$(this).hasClass('active')) {
$('.header .head_bottom .line').removeClass('hover');
$(this).addClass('hover');
// $('.head_dropdown').addClass('active');
// $('.head_dropdown .block_box').removeClass('active')
// $('.head_dropdown .block_box').eq($(this).index() - 1).addClass('active');
}
})
// $('.head_bottom li').hover(function () {
// $('.head_dropdown2').removeClass('active')
// $(this).find(".head_dropdown2").addClass('active').parent().siblings().find(".head_dropdown2").removeClass("active")
// $('.head_dropdown2').removeClass('active2')
// })
$('.head_dropdown .pc_down .close').click(function () {
$('.head_dropdown').removeClass('active')
$('.head_dropdown2').addClass('active2')
$('.header .head_bottom .line').removeClass('hover')
})
$('.secondary_head .tag').click(function () {
if (!$(this).hasClass('active')) {
$('.secondary_head .tag').removeClass('active');
$(this).addClass('active');
}
})
var aboutBlockSwiper = new Swiper('.aboutBlockSwiper', {
noSwiping: true,
noSwipingClass: 'swiper-slide',
})
var aboutTag_Swiper = new Swiper('.aboutTag_Swiper', {
spaceBetween: 58,
slidesPerView: 4,
loop: true,
loopAdditionalSlides:1,
prevButton: '.about .main3 .swiper-button-prev',
nextButton: '.about .main3 .swiper-button-next',
breakpoints: {
//当宽度小于等于640
768: {
slidesPerView: 1,
spaceBetween: 20,
}
},
onSlideChangeStart: function (swiper) {
aboutBlockSwiper.slideTo(swiper.realIndex, 1000, false)
}
})
$('.header .head_top .mobile_more').click(function () {
$('.header .head_top .mobile_more').toggleClass('active')
$('.head_dropdown').stop().slideToggle()
})
$('.head_dropdown .mobile_down .block .title_box .iconfont').click(function () {
if (!$(this).parent('.title_box').hasClass('active')) {
$('.head_dropdown .mobile_down .mobile_nav_down').slideUp()
$('.head_dropdown .mobile_down .block .mobile_nav_down1').slideUp()
$('.head_dropdown .mobile_down .block .title_box').removeClass('active')
$('.head_dropdown .mobile_down .block .line_box').removeClass('active')
}
$(this).parent('.title_box').toggleClass('active')
$(this).parent().next().stop().slideToggle()
})
$('.head_dropdown .mobile_down .block .mobile_nav_down .block1_box .line_box .iconfont').click(function () {
if (!$(this).parent('.line_box').hasClass('active')) {
$('.head_dropdown .mobile_down .block .mobile_nav_down1').slideUp()
$('.head_dropdown .mobile_down .block .line_box').removeClass('active')
}
$(this).parent().toggleClass('active')
$(this).parent().next().stop().slideToggle()
})
$('.contact .success .content .close').click(function () {
$('.contact .success').fadeOut()
})
$(".menuone > li").click(function () {
var $this = $(this);
$this.parents('.menuone:first').find('li').removeClass('active');
$this.addClass('active');
var oindex = $(this).attr('oindex');
$('.child').hide();
$('.child[tindex="'+oindex+'"]').fadeIn();
})
$(window).scroll(function() {
var targetPosition = $('#product-left').offset().top;
var currentPosition = $(window).scrollTop();
if (currentPosition >= targetPosition) { // 减50是为了给一点缓冲,防止还没完全到达就触发
$(".nav-main").addClass("active");
}else {
$(".nav-main").removeClass("active");
}
});
$(".pls-nav-search-wrap").click(function () {
$(this).addClass("is-open");
})
$(".pls-nav-search-bar-btns").click(function () {
$(".pls-nav-search-wrap").removeClass("is-open")
event.stopPropagation();
})
$(document).ready(function(){
// 设置一个定时器,每3000毫秒(即3秒)执行一次这个函数
setInterval(function(){
$(".pls-nav-search-texts li.is-active").removeClass("is-active").next().addClass("is-active");
}, 4000);
});
})