jquery(document).ready(function() {
// jquery("img").lazyload({
// effect : "fadein"
// });
new wow().init();
var content = $(".m-nav2").html();
$('.nav2 .nav-main2').append(content);
// header
$(window).scroll(function() {
if ($(window).scrolltop() > 0) {
$(".header").addclass("boxshdow");
$(".header.index").addclass("oth");
$(".header.index").find(".logo .img1").attr("src","/static/img/logo-oth.png");
} else {
$(".header").removeclass("boxshdow");
$(".header.index").removeclass("oth");
$(".header.index").find(".logo .img1").attr("src","/static/img/logo.png");
}
});
if ($(window).scrolltop() > 0) {
$(".header").addclass("boxshdow");
$(".header.index").addclass("oth");
$(".header.index").find(".logo .img1").attr("src","/static/img/logo-oth.png");
} else {
$(".header").removeclass("boxshdow");
$(".header.index").removeclass("oth");
$(".header.index").find(".logo .img1").attr("src","/static/img/logo.png");
}
$('.head-nav li').hover(function(){
$(this).find('.nav-main').addclass("show").stop(true,true);
},function(){
$(this).find('.nav-main').removeclass("show").stop(true,true);
});
$(window).scroll(function() {
if ($(this).scrolltop() >= 900) {
// console.log(11);
$(".fix-wx").fadein(500);
$(".fhtop").fadein(500);
} else {
$(".fix-wx").hide();
$(".fhtop").hide();
}
});
$(".dj-search").click(function(){
$(".search-main").slidedown();
});
$(".dj-search-close").click(function(){
$(".search-main").slideup();
});
$(".fhtop").click(function() {
return $("body,html").animate({
scrolltop: 0
},
500),
!1
});
$(".phone-nav").click(function(){
$(this).toggleclass( "active" )
if ($(this).hasclass('active')) {
$(".phone-nav-mn").addclass("on");
} else {
$(".phone-nav-mn").removeclass("on");
}
});
$(".enav-down .top").click(function(){
$(this).find(".jt").toggleclass("on");
$(this).parent().find(".bottom").slidetoggle();
});
$('.join-warp1 .picmain .more').hover(function(){
var _ = $(this);
_.addclass('on').siblings().removeclass('on');
});
$(".i-warp1 .mbf").click(function(){
$(".fix-video").fadein();
$(".fix-video").find(".video").trigger('play');
});
$(".fix-video .bg").click(function(){
$(".fix-video").fadeout();
$(".fix-video").find(".video").trigger('pause');
});
var swiperban = new swiper('#swiperban', {
slidesperview :1,
spacebetween: 0,
speed:800,
autoplay: {
delay:5000,
disableoninteraction: false,
},
loop:true,
effect:'fade',
simulatetouch : false,
navigation: {
nextel: '.i-page .page-r',
prevel: '.i-page .page-l',
},
on:{
init: function() {
numlist = '
';
for (p = 1; p <= (this.slides.length - 0); p++) {
numlist += '- ' + 0 + p + '
';
}
numlist += '
';
this.$el.find(' .swiper-pagination').html(numlist + '/' + '' + 0 + ( (this.slides.length - 2) ) + '');
//paginationrender会每次更新dom,无法产生动画效果,所以使用html()生成pagination
this.emit('transitionstart');
$(".i-banner .page .line").addclass("on");
},
transitionstart: function() {
realindex = this.realindex;
speed = this.params.speed;
bullets = this.$el.find(' .swiper-pagination li');
sldielength = bullets.length;
for (i = 0; i < sldielength; i++) {
if ((i - realindex) > math.floor(sldielength/2)) {
difference = i - sldielength - realindex;
} else if ((i - realindex) < -math.floor(sldielength/2)) {
difference = i + sldielength - realindex;
} else {
difference = i - realindex;
}
bullets.eq(i).transition(speed);
bullets.eq(i).transform('rotatex(' + difference * 30 + 'deg) translate3d(0, ' + difference * 60 + 'px, 0)') ;
bullets.eq(i).css('opacity', 1 - math.abs(difference));
}
$(".i-banner .page .line").removeclass("on");
},
// slidechangetransitionend: function(){
// $(".i-banner .page .line").removeclass("on");
// },
transitionend: function(){
$(".i-banner .page .line").addclass("on");
},
},
});
$(".i-page .page-l").click(function(){
$(".i-banner .page .line").removeclass("on");
});
$(".i-page .page-r").click(function(){
$(".i-banner .page .line").removeclass("on");
});
var swiperipro = new swiper('.swiperipro', {
slidesperview :1,
speed:800,
spacebetween: 10,
observer:true,
observeparents:true,
observeslidechildren:true,
on: {
init: function(){
swiperanimatecache(this);
swiperanimate(this);
},
slidechangetransitionend: function(){
swiperanimate(this);
},
slidechangetransitionstart: function(){
$('.i-warp2 .ul-page li.on').removeclass('on');
$('.i-warp2 .ul-page li').eq(swiperipro.activeindex).addclass('on');
var _ = $('.i-warp2 .ul-page li.on');
if (_.hasclass('one')) {
_.parent().parent().find(".line").removeclass("one two four five");
_.parent().parent().find(".line").addclass("one");
}else if (_.hasclass('two')) {
_.parent().parent().find(".line").removeclass("one three four five");
_.parent().parent().find(".line").addclass("two");
}else if (_.hasclass('three')) {
_.parent().parent().find(".line").removeclass("one two four five");
_.parent().parent().find(".line").addclass("three");
}else if (_.hasclass('four')) {
_.parent().parent().find(".line").removeclass("one three two five");
_.parent().parent().find(".line").addclass("four");
}else{
_.parent().parent().find(".line").removeclass("one three four two");
_.parent().parent().find(".line").addclass("five");
}
},
},
});
$('.i-warp2 .ul-page li').hover(function(){
var _ = $(this);
_.addclass('on').siblings().removeclass('on');
swiperipro.slideto(_.index());
if (_.hasclass('one')) {
_.parent().parent().find(".line").removeclass("one two four five");
_.parent().parent().find(".line").addclass("one");
}else if (_.hasclass('two')) {
_.parent().parent().find(".line").removeclass("one three four five");
_.parent().parent().find(".line").addclass("two");
}else if (_.hasclass('three')) {
_.parent().parent().find(".line").removeclass("one two four five");
_.parent().parent().find(".line").addclass("three");
}else if (_.hasclass('four')) {
_.parent().parent().find(".line").removeclass("one three two five");
_.parent().parent().find(".line").addclass("four");
}else{
_.parent().parent().find(".line").removeclass("one three four two");
_.parent().parent().find(".line").addclass("five");
}
return false;
});
$('.foot-nav .mn').hover(function(){
var _ = $(this);
_.addclass('on').siblings().removeclass('on');
if (_.hasclass('mn0')) {
_.parent().find(".dqtb").removeclass("mn0 mn1 mn3 mn4 mn5");
_.parent().find(".dqtb").addclass("mn0");
}else if (_.hasclass('mn1')) {
_.parent().find(".dqtb").removeclass("mn0 mn2 mn3 mn4 mn5");
_.parent().find(".dqtb").addclass("mn1");
}else if (_.hasclass('mn2')) {
_.parent().find(".dqtb").removeclass("mn0 mn1 mn3 mn4 mn5");
_.parent().find(".dqtb").addclass("mn2");
}else if (_.hasclass('mn3')) {
_.parent().find(".dqtb").removeclass("mn0 mn2 mn1 mn4 mn5");
_.parent().find(".dqtb").addclass("mn3");
}else if (_.hasclass('mn4')) {
_.parent().find(".dqtb").removeclass("mn0 mn2 mn1 mn3 mn5");
_.parent().find(".dqtb").addclass("mn4");
}else{
_.parent().find(".dqtb").removeclass("mn0 mn2 mn3 mn1 mn4");
_.parent().find(".dqtb").addclass("mn5");
}
return false;
});
var mfootclass = $('.foot-nav .mn.on');
if (mfootclass.hasclass('mn0')) {
mfootclass.parent().find(".dqtb").removeclass("mn0 mn1 mn3 mn4 mn5");
mfootclass.parent().find(".dqtb").addclass("mn0");
}else if (mfootclass.hasclass('mn1')) {
mfootclass.parent().find(".dqtb").removeclass("mn0 mn2 mn3 mn4 mn5");
mfootclass.parent().find(".dqtb").addclass("mn1");
}else if (mfootclass.hasclass('mn2')) {
mfootclass.parent().find(".dqtb").removeclass("mn0 mn1 mn3 mn4 mn5");
mfootclass.parent().find(".dqtb").addclass("mn2");
}else if (mfootclass.hasclass('mn3')) {
mfootclass.parent().find(".dqtb").removeclass("mn0 mn2 mn1 mn4 mn5");
mfootclass.parent().find(".dqtb").addclass("mn3");
}else if (mfootclass.hasclass('mn4')) {
mfootclass.parent().find(".dqtb").removeclass("mn0 mn2 mn1 mn3 mn5");
mfootclass.parent().find(".dqtb").addclass("mn4");
}else{
mfootclass.parent().find(".dqtb").removeclass("mn0 mn2 mn3 mn1 mn4");
mfootclass.parent().find(".dqtb").addclass("mn5");
}
// 基金会
var swiperjjh = new swiper('.jjh-news .swiper-container', {
slidesperview :1,
spacebetween: 20,
speed:800,
observer:true,
observeparents:true,
observeslidechildren:true,
loop:true,
navigation: {
nextel: '.jjh-news .next',
prevel: '.jjh-news .prev',
},
breakpoints: {
600: {
slidesperview :2,
spacebetween: 30,
},
940: {
slidesperview :3,
spacebetween: 66,
},
}
});
// 团队风采
var swiperdeve2 = new swiper('.swiperdeve2', {
watchslidesprogress: true,
slidesperview: 1,
spacebetween: 0,
centeredslides : true,
loop: true,
loopedslides: 5,
speed:800,
// autoplay: true,
navigation: {
nextel: '.deve-warp3 .main .next',
prevel: '.deve-warp3 .main .prev',
},
breakpoints: {
768: {
slidesperview: 'auto',
spacebetween: 38,
},
},
on: {
progress: function(progress) {
for (i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
var slideprogress = this.slides[i].progress;
modify = 1;
if (math.abs(slideprogress) > 1) {
modify = (math.abs(slideprogress) - 1) * 0.3 + 1;
}
translate = slideprogress * modify * 280 + 'px';
scale = 1 - math.abs(slideprogress) / 5.6;
zindex = 999 - math.abs(math.round(10 * slideprogress));
slide.transform('translatex(0) scale(' + scale + ')');
slide.css('zindex', zindex);
slide.css('opacity', 1);
if (math.abs(slideprogress) > 3) {
slide.css('opacity', 0);
}
}
},
settransition: function(transition) {
for (var i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i)
slide.transition(transition);
}
}
}
});
// 地产
var swipercasedc1 = new swiper('.casedc-read-warp1 .swiper-container', {
slidesperview :1,
spacebetween: 0,
speed:800,
autoplay: {
delay:5000,
disableoninteraction: false,
},
loop:true,
effect:'fade',
simulatetouch : false,
pagination: {
el: '.casedc-read-warp1 .swiper-pagination',
clickable :true,
},
});
var swipercasedc2 = new swiper('.casedc-read-warp3 .swiper-container', {
slidesperview: 1,
spacebetween: 10,
speed:800,
autoplay: {
delay:5000,
disableoninteraction: false,
},
navigation: {
nextel: '.casedc-read-warp3 .page-r',
prevel: '.casedc-read-warp3 .page-l',
},
breakpoints: {
600: {
slidesperview: 2,
spacebetween: 20,
},
940: {
slidesperview: 4,
slidespercolumn : 2,
slidespercolumnfill : 'row',
spacebetween: 29,
},
}
});
});