$(function(){ var headh = $(".header-wrapper").height(); var winh = $(window).height(); //$('body').css("padding-top",headh) $("[winh]").css("height",winh - headh +'px'); // $("#bannerbox").css("height",$(window).height()); if ($(".dsvg")[0]) { var winha = $(window).height(); var headh = $(".header-wrapper").height(); //$("[winh]").css("height",winh-headh+'px'); $(".dsvg").click(function(){ $("body,html").animate({scrolltop:winha-headh},700) }) } $(".navbar-nav li").hover(function(){ $(this).find(".ej-nav").stop().slidedown(); },function(){ $(this).find(".ej-nav").stop().slideup(); }); $(".ban-btns a").hover(function(){ $(".ban-txt .line").addclass("active") },function(){ $(".ban-txt .line").removeclass("active") }) var headt = $(".header-wrapper").offset().top; $(window).scroll(function(){ if($(this).scrolltop() > headt){ $(".header-wrapper").addclass("activehead"); $("#headlogo img").attr("src",$("#headlogo img").attr("blackimg")) } else{ $(".header-wrapper").removeclass("activehead"); $("#headlogo img").attr("src",$("#headlogo img").attr("whiteimg")) } }); if ($(".c-listxx .item")[0]) { function vtxt(){ var len = $(".c-list .item").size(); var i = 0; var timeid = setinterval(function () { if (i < len-1) { i++; } else { i=0; } $(".c-list .item").removeclass("show") settimeout(function(){$(".c-list .item").eq(i).addclass("show")},500) //console.log('定时运行:' + i + '次') }, 5000) } vtxt() } $(".case").hover(function(){ $(this).find(".rsp").stop().fadeto(500,0.5); $(this).find(".text").stop().animate({left:'0'}, {duration: 500}); }, function(){ $(this).find(".rsp").stop().fadeto(500,0); $(this).find(".text").stop().animate({left:'100%'}, {duration: "fast"}); $(this).find(".text").animate({left:'-100%'}, {duration: 0}); }); $("#top").click(function(){ $("body,html").animate({scrolltop:0},700) }); $('.left').hover(function() { $(this).find('.bg').css('width', '106%'); $(this).find('.cover').css('opacity', '0'); $('.created-txt').css('opacity', '1'); }, function() { $(this).find('.cover').css('opacity', '1'); $('.created-txt').css('opacity', '0'); }) $('.middle').hover(function() { $(this).find('.bg').css('width', '100%'); $('.left .bg').css('width', '70%'); $(this).find('.cover').css('opacity', '0'); $('.seat-display').css('opacity', '1'); $('.seat-info').css('left', '0%'); }, function() { $('.left .bg').css('width', '80%'); $(this).find('.bg').css('width', '80%'); $(this).find('.cover').css('opacity', '1'); $('.seat-display').css('opacity', '0'); $('.seat-info').css('left', '10%'); }) $('.right').hover(function() { $('.middle .bg').css('width', '60%'); $(this).find('.cover').css('opacity', '0'); $('.right-seat-display').css('opacity', '1'); $('.right-seat').css('left', '10%'); $('.seat-display').css('width', '50px'); }, function() { $('.middle .bg').css('width', '80%'); $(this).find('.cover').css('opacity', '1'); $('.right-seat-display').css('opacity', '0'); $('.right-seat').css('left', '32%'); $('.seat-display').css('width', '80%'); }) $(".lf-add-list .item .ti").click(function(){ $(this).parents(".item").addclass("on").siblings().removeclass("on"); $(this).siblings(".c-mes").slidedown(); $(this).parents(".item").siblings().find(".c-mes").slideup(); }) //切换效果 $("[tabid]").click(function(){ $(this).addclass("on").siblings("[tabid]").removeclass("on"); $("#" + $(this).attr("tabid")).fadein().siblings().hide(); }); $(".in-about-clist ul li").hover(function(){ $(this).addclass("on").siblings().removeclass("on") }) var swiperban = new swiper('#bannerbox',{ //effect : 'fade', speed:1000, autoplay: { delay: 5000, stoponlastslide: false, disableoninteraction: false, }, observer:true, observeparents:true, navigation: { nextel: '#bannext', prevel: '#banprev', }, pagination: { el: '#pcswpage', clickable :true, }, on: { init: function(){ $("#bannerbox .swiper-slide").eq(0).find("h1,h2,.m,.t,.p,.ban-move-box,.line").addclass("fadeindown"); }, slidechangetransitionend: function(){ //alert(this.activeindex);//切换结束时,告诉我现在是第几个slide $("#bannerbox .swiper-slide").find("h1,h2,.m,.t,.p,.ban-move-box,.line").removeclass("fadeindown"); $("#bannerbox .swiper-slide").eq(this.activeindex).find("h1,h2,.m,.t,.p,.ban-move-box,.line").addclass("fadeindown"); }, }, }); var swiperbanm = new swiper('#bannerboxmob',{ //effect : 'fade', autoplay: { delay: 5000, stoponlastslide: false, disableoninteraction: true, }, observer:true, pagination: { el: '#mobswpage', clickable :true, }, on: { init: function(){ $("#bannerboxmob .swiper-slide").eq(0).find("h3,.p1,.p2,.p3,.ban-move-box,.line").addclass("fadeindown"); }, slidechangetransitionend: function(){ //alert(this.activeindex);//切换结束时,告诉我现在是第几个slide $("#bannerboxmob .swiper-slide").find("h3,.p1,.p2,.p3,.ban-move-box,.line").removeclass("fadeindown"); $("#bannerboxmob .swiper-slide").eq(this.activeindex).find("h3,.p1,.p2,.p3,.ban-move-box,.line").addclass("fadeindown"); }, }, }); var swiperpromo = new swiper('#homeaboutswp',{ //effect : 'fade', autoplay: { delay: 5000, stoponlastslide: false, disableoninteraction: true, }, slidesperview:4, breakpoints: { 320: { slidesperview: 2, }, 768: { slidesperview: 3, }, 1280: { slidesperview: 4, } }, observer:true, pagination: { el: '#homeaboutpage', clickable :true, } }); var swiperor = new swiper('#bannerboxmob',{ //effect : 'fade', autoplay:true }); var swipercns = new swiper('#cnsswp',{ //effect : 'fade', //autoplay:true, slidesperview:4, spacebetween:34, navigation: { nextel: '#cnsnext', prevel: '#csnprev', }, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesperview: 2, spacebetween: 5 }, 768: { //当屏幕宽度大于等于768 slidesperview: 2, spacebetween: 10 }, 1280: { //当屏幕宽度大于等于1280 slidesperview: 4, spacebetween: 34 } } }); var swiperhon = new swiper('#honswp',{ //effect : 'fade', //autoplay:true, slidesperview:4, spacebetween:25, pagination: { el: '#honpage', clickable :true, }, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesperview: 2, spacebetween: 5 }, 768: { //当屏幕宽度大于等于768 slidesperview: 2, spacebetween: 10 }, 1280: { //当屏幕宽度大于等于1280 slidesperview: 4, spacebetween: 20 } } }); var swipernewsswp = new swiper('#newsswp',{ navigation: { nextel: '#newsnext', prevel: '#newsprev', }, pagination: { el: '.pnums', type: 'fraction', clickable :true, }, observer:true, }); var swiperpromo6 = new swiper('#aboutcswp',{ //effect : 'fade', observer:true, pagination: { el: '#aboutsp', clickable :true, } }); var swiperhon = new swiper('#abpart',{ //effect : 'fade', //autoplay:true, slidesperview:6, spacebetween:20, navigation: { nextel: '#parnext', prevel: '#parprev', }, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesperview: 2, spacebetween: 5 }, 768: { //当屏幕宽度大于等于768 slidesperview: 3, spacebetween: 8 }, 1280: { //当屏幕宽度大于等于1280 slidesperview: 6, spacebetween: 15 } } }); if ($(".home-case")[0]) { var socrtop = $(".home-case").offset().top; var winh =$(window).height(); var wscr = 0; var caseh = $(".hm-case").height(); var casewt = (winh - caseh)/2; var casewt2 = winh - (caseh/2) $(window).scroll(function(e){ wscr = $(this).scrolltop(); var casetp = socrtop - casewt; var casetp2 = socrtop - casewt2; if(casetp2 < wscr && wscr < casetp){ //$(".fixs").html(wscr - casetp); var tr = (wscr - casetp)/6 + 'px'; var tr2 = (0 - (wscr - casetp)/6) + 'px'; var opt = (100 + (wscr - casetp)/6)/100; $(".sty").css("transform","translatey("+tr+")"); $(".slx").css("transform","translatex("+tr+")"); $(".srx").css("transform","translatex("+tr2+")"); $(".sby").css("transform","translatey("+tr2+")"); $(".hm-case ul li").css("opacity",opt); }if(wscr > casetp){ $(".sty").css("transform","translatey(0px)"); $(".slx").css("transform","translatex(0px)"); $(".srx").css("transform","translatex(0px)"); $(".sby").css("transform","translatey(0px)"); $(".hm-case ul li").css("opacity",1); } }) } if ($("#numgo")[0]) { var stt = $("#numgo").offset().top; var wh = window.screen.height; var isfirst = true; $(window).scroll(function(){ if ($(this).scrolltop() > stt - wh + 500 ) { $("#numgo").addclass("active"); if(isfirst){ $.fn.countto = function (options) { options = options || {}; return $(this).each(function () { // set options for current element var settings = $.extend({}, $.fn.countto.defaults, { from: $(this).data('from'), to: $(this).data('to'), speed: $(this).data('speed'), refreshinterval: $(this).data('refresh-interval'), decimals: $(this).data('decimals') }, options); // how many times to update the value, and how much to increment the value on each update var loops = math.ceil(settings.speed / settings.refreshinterval), increment = (settings.to - settings.from) / loops; // references & variables that will change with each update var self = this, $self = $(this), loopcount = 0, value = settings.from, data = $self.data('countto') || {}; $self.data('countto', data); // if an existing interval can be found, clear it first if (data.interval) { clearinterval(data.interval); } data.interval = setinterval(updatetimer, settings.refreshinterval); // initialize the element with the starting value render(value); function updatetimer() { value += increment; loopcount++; render(value); if (typeof(settings.onupdate) == 'function') { settings.onupdate.call(self, value); } if (loopcount >= loops) { // remove the interval $self.removedata('countto'); clearinterval(data.interval); value = settings.to; if (typeof(settings.oncomplete) == 'function') { settings.oncomplete.call(self, value); } } } function render(value) { var formattedvalue = settings.formatter.call(self, value, settings); $self.html(formattedvalue); } }); }; $.fn.countto.defaults = { from: 0, // the number the element should start at to: 0, // the number the element should end at speed: 1000, // how long it should take to count between the target numbers refreshinterval: 100, // how often the element should be updated decimals: 0, // the number of decimal places to show formatter: formatter, // handler for formatting the value before rendering onupdate: null, // callback method for every time the element is updated oncomplete: null // callback method for when the element finishes updating }; function formatter(value, settings) { return value.tofixed(settings.decimals); } // custom formatting example $('.number-c').data('counttooptions', { formatter: function (value, options) { return value.tofixed(options.decimals).replace(/\b(?=(?:\d{3})+(?!\d))/g, ''); } }); // start all the timers $('.number-c').each(count); function count(options) { var $this = $(this); options = $.extend({}, options || {}, $this.data('counttooptions') || {}); $this.countto(options); } isfirst = false; } } }) } });