(function() { //瀹氫箟椤甸潰鍙傛暟 var index = { render: function() { //澶撮儴瀵艰埅杞挱 this.BannerFlexslider(); //鏍忕洰杞挱濯掍綋鍖楀ぇ-鏍″洯鏂囧寲 this.modeFlexslider(); //鍨傜洿婊氬姩鏉 //this.scroll(); }, //澶撮儴瀵艰埅杞挱 BannerFlexslider: function() { $(".Banner .flexslider").flexslider({ animation: 'fade', animationLoop: true, slideshowSpeed: 4000, //灞曠ず鏃堕棿闂撮殧ms animationSpeed: 400, //婊氬姩鏃堕棿ms touch: true //鏄惁鏀寔瑙﹀睆婊戝姩 }); }, //鏍忕洰杞挱濯掍綋鍖楀ぇ-鏍″洯鏂囧寲 modeFlexslider: function() { var iWSon = document.documentElement.clientWidth; if (iWSon <= 480) { x = 0 } else if (iWSon <= 768) { x = iWSon / 2 - 30 } else if (iWSon <= 1480) { x = 230 } else { x = 300 } $(".mode02 .flexslider").flexslider({ animation: "slide", animationLoop: true, itemWidth: x, itemMargin: 20, minItems: 1, maxItems: 4 // pausePlay: true }); } } // 娓叉煋椤甸潰 index.render(); $(window).resize(function() { // 娓叉煋椤甸潰 //index.render(); }) var resizeTimer = null; $(window).bind('resize', function() { if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { index.render('scroll'); index.render('modeFlexslider'); }, 500); }); })(); // $('.Banner .flex-control-nav li a').each(function(){ // if(parseInt($(this).text())<10){ // $(this).text('0'+$(this).text()) //琛ラ綈 // } // }) $('.flex-direction-nav a').each(function(e) { var $this = $(this) $this.addClass('iconfont'); $this.text(''); if ($this.hasClass('flex-prev')) { $(this).addClass('icon-arrow') } else if ($this.hasClass('flex-next')) { $(this).addClass('icon-arrow1') } }) $('.Banner').find('.videoPlay').click(function() { var slider = $('.Banner .flexslider').data('flexslider'); var thisPlay = $(this).parent().parent('.pku-video'); var videoDd = $('.videoShow').find('dd'); videoDd.eq(thisPlay.index()).show().siblings().hide(); videoDd.eq(thisPlay.index()).find('video').get(0).play() $('.videoClose').css('display', 'block'); slider.pause() $('.videoClose').click(function() { slider.play() $('.videoShow').find('dd').hide(); videoDd.eq(thisPlay.index()).find('video').get(0).pause() $(this).hide(); }) }) $(function() { $('.pku-list02 .videoPlay').click(function() { $(this).closest('li').find('.pku2_video').css('display', 'block'); $(this).closest('li').find('video')[0].play(); }) $('.pku2_close').click(function() { $(this).closest('.pku2_video').css('display', 'none'); $(this).closest('.pku2_video').find('video')[0].pause(); }) })