|
@@ -307,9 +307,40 @@
|
|
|
var pageIndex = {
|
|
|
init: function() {
|
|
|
this.lunBoFn() // banner轮播
|
|
|
+ this.calcHeaderTheme()
|
|
|
this.setCopyRightForBottom() // 设置copyright
|
|
|
},
|
|
|
+ calcHeaderTheme: function () {
|
|
|
+ var img = null
|
|
|
+ var activeSlide = document.getElementsByClassName('swiper-slide-active')
|
|
|
+ console.log(activeSlide)
|
|
|
+ if (activeSlide.length > 0) {
|
|
|
+ img = activeSlide[0].children[0]
|
|
|
+ } else {
|
|
|
+ img = $('#bannerSwiper').find('swiper-slide:eq(0) img')[0]
|
|
|
+ }
|
|
|
+ var theme = $(img).attr('data-theme')
|
|
|
+ var opa = $(document).scrollTop() / 20
|
|
|
+ if (opa < 1) {
|
|
|
+ if (theme === 'light') {
|
|
|
+ setTimeout(function(){
|
|
|
+ $('.public-nav').addClass('light-bg-dark-color').removeClass('light-bg-light-color')
|
|
|
+ $('.swiper-pagination').addClass('light-swiper-bg-dark-color').removeClass('light-swiper-bg-light-color')
|
|
|
+ $('.loginBtn').css('color', '#1d1d1d')
|
|
|
+ }, 100)
|
|
|
+ } else {
|
|
|
+ setTimeout(function(){
|
|
|
+ $('.public-nav').addClass('light-bg-light-color').removeClass('light-bg-dark-color')
|
|
|
+ $('.loginBtn').css('color', '#fff')
|
|
|
+ var a = $('.jy-index .jy-index-banner .custom-dot .swiper-pagination-bullet-active')
|
|
|
+ // $('.jy-index .jy-index-banner .custom-dot .swiper-pagination-bullet').css('background', 'rgba(255, 255, 255, 0.32)')
|
|
|
+ $('.swiper-pagination').addClass('light-swiper-bg-light-color').removeClass('light-swiper-bg-dark-color')
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
lunBoFn: function () {
|
|
|
+ var calcHeaderTheme = this.calcHeaderTheme()
|
|
|
// banner广告位轮播
|
|
|
var bannerSwiper = new Swiper('#bannerSwiper', {
|
|
|
slidesPerView: 1,
|
|
@@ -327,26 +358,7 @@
|
|
|
loop: $('#bannerSwiper').find('.swiper-slide').length > 1 ? true : false, // imageList.length > 1 ? true : false
|
|
|
on: {
|
|
|
slideChangeTransitionStart: function() {
|
|
|
- var img = document.getElementsByClassName('swiper-slide-active')[0].children[0];
|
|
|
- var theme = $(img).attr('data-theme')
|
|
|
- var opa = $(document).scrollTop() / 20
|
|
|
- if (opa < 1) {
|
|
|
- if (theme === 'light') {
|
|
|
- setTimeout(function(){
|
|
|
- $('.public-nav').addClass('light-bg-dark-color').removeClass('light-bg-light-color')
|
|
|
- $('.swiper-pagination').addClass('light-swiper-bg-dark-color').removeClass('light-swiper-bg-light-color')
|
|
|
- $('.loginBtn').css('color', '#1d1d1d')
|
|
|
- }, 100)
|
|
|
- } else {
|
|
|
- setTimeout(function(){
|
|
|
- $('.public-nav').addClass('light-bg-light-color').removeClass('light-bg-dark-color')
|
|
|
- $('.loginBtn').css('color', '#fff')
|
|
|
- var a = $('.jy-index .jy-index-banner .custom-dot .swiper-pagination-bullet-active')
|
|
|
- // $('.jy-index .jy-index-banner .custom-dot .swiper-pagination-bullet').css('background', 'rgba(255, 255, 255, 0.32)')
|
|
|
- $('.swiper-pagination').addClass('light-swiper-bg-light-color').removeClass('light-swiper-bg-dark-color')
|
|
|
- }, 100)
|
|
|
- }
|
|
|
- }
|
|
|
+ calcHeaderTheme()
|
|
|
}
|
|
|
}
|
|
|
});
|