jquery(function(){ var swipernested1=null; function initbox() { w_width = jquery(window).width(); w_height = jquery(window).height(); $('.banner-box,.business').css('height',w_height); $('.banner,.busineli').css('height',w_height); $('.bannlist >li,.bannlist >li figure,.busineli >li,.busineli >li figure').css('height',w_height); setimgmax($('.bannlist >li figure .bimg'), 1904, 960, w_width, w_height); setimgmax($('.busineli >li figure img'), 1904, 944, w_width, w_height); if(!ismobile){ }else{ $('.bannlist >li figure .bimg,.busineli li figure img').width(w_width); } }; initbox(); jquery(window).resize(function () { initbox(); }); jquery(function(){ var bannersider=jquery(".banner"); bannersider.flexslider({ animation: "fade", pauseonhover: false, animationloop: true, slideshow: true, slideshowspeed: 5000, animationspeed: 0, directionnav:false, controlnav:false, start: function(slider) { jquery(".bamnline").addclass("load"); }, after: function(slider) { jquery(".bamnline").addclass("load"); }, before: function(slider) { jquery(".bamnline").removeclass("load"); } }); }); jquery(function(){ var bannersider=jquery(".business"); bannersider.flexslider({ animation: "fade", animationloop: true, slideshow: true, slideshowspeed: 4400, animationspeed: 0, manualcontrols:".businees li", pauseonaction: true, directionnav:true, controlnav:true }); }); jquery(function(){ var bannersider=jquery(".informates"); bannersider.flexslider({ animation: "slide", animationloop: false, slideshow: false, slideshowspeed: 3400, animationspeed: 780, manualcontrols:".informatebtn span", pauseonaction: true, directionnav:false, controlnav:true }); }); var video = { load: function (objs) { var objplay = jwplayer(objs.vcontainer).setup({ flashplayer: 'js/video/flashplay.swf', html5player: 'js/video/html5player.js', file: objs.vfiles, image: objs.vfimg, width: '100%', height:'100%', aspectratio:'16:9', stretching:'fill', controls: 'true', autostart: objs.isautoplay }); return objplay; } } jquery(function () { jquery('.trailer a').click(function () { video.load({ vcontainer: 'videobox', //视频容器 vfimg: jquery(this).attr("data-video-image"),//视频地址 vfiles: jquery(this).attr("data-video-url"), //视频缩略图(封面) isautoplay: 'true' }); jquery(".vwrap").fadein(500).addclass('hide'); }); jquery(".vwrap .close,.vwrap .videobtg").click(function () { jquery(".vwrap").hide().removeclass('hide'); $('#videobox').html(""); }); }); var heinow=$('.footdown').outerheight()+3*w_height; var $wrap = $('.wrapper'), pages = $('.page').length, scrolling = false, currentpage = 1, $navpanel = $('.nav-panel'), $scrollbtn = $('.scroll-btn'), $navbtn = $('.nav-btn'); function manageclasses() { $wrap.removeclass(function (index, css) { return (css.match(/(^|\s)active-page\s+/g) || []).join(' '); }); $wrap.addclass('active-page' + currentpage); $navbtn.removeclass('active'); $('.nav-btn.nav-page' + currentpage).addclass('active'); $navpanel.addclass('invisible'); scrolling = true; settimeout(function () { $navpanel.removeclass('invisible'); scrolling = false; }, 600); } function navigateup() { if (currentpage > 1) { currentpage--; manageclasses(); $wrap.animate({ 'top': -(currentpage-1)*w_height }, 600); $('.side_btn_ul').addclass('in'); } if (currentpage == 1){ $('.side_btn_ul').removeclass('in'); } } jquery(window).resize(function () { if(!ismobile){ $('.page,.wrapper,.pagebg img').css('height',w_height); $('.page6').css('height',$('.footer').outerheight()); } if(currentpage==5){ var hnum=jquery(".footer-box").innerheight(); $wrap.animate({ 'top': (-3*w_height)-hnum }, 0); }else{ $wrap.animate({ 'top': -(currentpage-1)*w_height }, 0); } }); if(!ismobile){ $('.page,.wrapper,.pagebg img').css('height',w_height); $('.page5').css('height',$('.footdown').outerheight()); } function navigatedown() { if (currentpage < pages) { currentpage++; manageclasses(); if(currentpage==5){ var hnum=jquery(".footdown").innerheight(); $wrap.animate({ 'top': (-3*w_height)-hnum }, 500); }else{ $wrap.animate({ 'top': -(currentpage-1)*w_height }, 600); } } } $(document).on('mousewheel dommousescroll', function (e) { if(!scrolling&&!ismobile){ if (e.originalevent.wheeldelta > 0 || e.originalevent.detail < 0) { navigateup(); } else { navigatedown(); } } }); $(document).on('click', '.nav-btn:not(.active)', function () { if (!scrolling) { var target = $(this).attr('data-target'); $wrap.removeclass(function (index, css) { return (css.match(/(^|\s)active-page\s+/g) || []).join(' '); }); $wrap.addclass('active-page' + target); $navbtn.removeclass('active'); $(this).addclass('active'); currentpage = target; scrolling = true; settimeout(function () { scrolling = false; }, 1000); $wrap.animate({ 'top': '-' + (target - 1) * 100 + '%' }, 600); } }); $('body').running(); });