;(function () { 'use strict'; var cybanner = function () { var _cybannerpic = $('.cy-banner-pic'), _cybanneran = $('.cy-bannera'), _cybanneranarrows = $('.cy-bannera-arrows'), _cybannernext = $('.cy-banner-next'), _cyheader = $('.cy-header'); var _cybannerh, _cyheaderh; if ($(window).width() >= 1200) { _cyheaderh = 70; if ($(window).width() >= 1440) { _cyheaderh = 80; } if ($(window).width() >= 1800) { _cyheaderh = 90; } _cybannerh = $(window).height() - _cyheaderh; _cybannerpic.css({'height': _cybannerh}); $(window).resize(function () { _cybannerh = $(window).height() - _cyheader.height(); _cybannerpic.css({'height': _cybannerh}); }); } _cybannerpic.slick({ autoplay: true, autoplayspeed: 5000, appendarrows: $('.cy-bannerp-arrows'), prevarrow: $('.cy-bannerp-prep'), nextarrow: $('.cy-bannerp-next'), pauseonhover: false }).on('afterchange', function(event, slick, currentslide){ _cybannerpliner(); }); _cybannerpliner(); function _cybannerpliner() { var _bc = $('.cy-bannerp-item'), _current = $('.slick-current'); _bc.find('.cy-bp-text p span').css('width', '0'); _bc.find('.cy-ga').addclass('action'); if (_bc.hasclass('slick-current')) { _current.find('.cy-bp-text p span').stop(true, true).animate({ width: '100%' }, 5000, 'linear', function () { $(this).css('width', '0'); }); _current.find('.cy-ga').addclass('action'); _current.siblings().find('.cy-ga').removeclass('action'); } } _cybanneran.slick({ autoplay: true, autoplayspeed: 2000, appendarrows: _cybanneranarrows, prevarrow: $('.cy-bannera-prep'), nextarrow: $('.cy-bannera-next'), vertical: true, verticalswiping: true }).on('beforechange', function(event, slick, currentslide, nextslide){ var _index = nextslide + 1; _cybanneranarrows.find('p span:first').text(_index); }); var _item = _cybanneran.find('.cy-bannera-item').length > 1 ? _cybanneran.find('.cy-bannera-item').length - 2 : '1'; _cybanneranarrows.find('p span:last').text(_item); _cybannernext.click(function () { $('html, body').animate({ scrolltop: $(window).height() - $('.cy-header').height() //she need some js to jump , wait me ! let me fly ! i want to fly . }, 380); }); }; var cynews = function () { var _cynewsbanner = $('.cy-newsb-list'), _cynewslisttitle = $('.cy-newsl-title'), _cynewslistcont = $('.cy-newsl-cont'); _cynewsbanner.slick({ autoplay: true, autoplayspeed: 3000, dots: true, prevarrow: $('.cy-newsb-prep'), nextarrow: $('.cy-newsb-next'), appenddots: $('.cy-newsb-arrows'), }); _cynewslisttitle.find('ul li').each(function () { var _this = $(this), _index = _this.index(); _this.click(function () { _this.addclass('cy-active').siblings().removeclass('cy-active'); _cynewslistcont.find('ul').eq(_index).slidedown().siblings().slideup().removeclass('cy-active'); }); }); }; var cyparty = function () { var _cypwtitle = $('.cy-pw-title'), _cypwcont = $('.cy-pw-cont'); _cypwtitle.find('li').each(function () { var _this = $(this), _index = $(this).index(); _this.click(function () { _this.addclass('cy-active').siblings().removeclass('cy-active'); _cypwcont.find('ul').eq(_index).fadein().siblings().fadeout().removeclass('cy-active'); }); }); }; var cyculture = function () { var _cyculturetitle = $('.cy-culture-title'), _cyculturecont = $('.cy-culture-cont'); _cyculturetitle.find('li').each(function () { var _this = $(this), _index = $(this).index(); _this.click(function () { _this.addclass('cy-active').siblings().removeclass('cy-active'); _cyculturecont.find('ul').eq(_index).slidedown(1500).siblings().hide().removeclass('cy-active'); }); }); }; $(function () { cybanner(); cynews(); cyparty(); cyculture(); }); }());