function gotop(){ $(window).scroll(function(e) { if($(window).scrolltop()>100) $(".gotop").fadein(350).css("display","block"); else $(".gotop").fadeout(350).css("display","none"); }); $(".gotop").click(function(e) { $('body,html').animate({scrolltop:0},500); return false; }); }; $(document).ready(function() { //搴曢儴鍥哄畾鍖哄煙鍗犱綅 if( $(".fixed-bottom").is(":visible") ){ $("#wrapper").css( "paddingbottom",$(".fixed-bottom").height() ); }else{ } //杩斿洖椤堕儴 gotop(); //鍐呭鍔犺浇鍚庣殑杩愬姩鏁堟灉 dataanimate(); // 澶氳瑷€ $('.language ul.sf-menu').superfish({ delay: 500, animation: {opacity:'fast',height:'show'}, speed: 'fast', autoarrows: true, dropshadows: false }); // 瀵艰埅鑿滃崟 $('.main-nav ul.sf-menu').superfish({ delay: 500, animation: {opacity:'fast',height:'show'}, speed: 'fast', autoarrows: true, dropshadows: false }); $('.main-nav ul.sf-menu > li').last().addclass('last').end().hover(function(){ $(this).addclass('nav-hover'); },function(){ $(this).removeclass('nav-hover'); }); //鑿滃崟鍔ㄦ€佸垏鎹㈤〉闈㈡晥鏋? $(".main-nav li a, .logo a").click(function(){ if( $(this).attr("target") != "_blank"){ if( $(this).attr("href") != "javascript:;" && $(this).attr("href") != "#" ) return openwork($(this).attr("href")); } }); function openwork(url){ $("#wrapper").css({'-webkit-animation':"bouncein 0.5s .25s ease both",'-moz-animation':'bouncein 1s .25s ease both','animation':'bouncein 0.5s .25s ease both'}); $("body").append("
").css("position","relative"); $(".page-cover").delay(600).animate({"height":$(document).height()},800,null,function(){ location.href = url; }); return false }; //tab $(".tabs-nav").tabs(" > .tabs-panes > div"); //scrollable in tab $(".tabs-nav > li > a").click(function(){ var _tabindex = $(this).parents(".tabs-nav").find("li").index($(this).parent()); if( $(this).parents(".tabs-default").find(".tab-box").eq(_tabindex).find(".scrollable-default").length > 0 ){ $(".scrollable-default").caroufredsel({ width : '100%', infinite : false, circular : false, auto : { pauseonhover: true, timeoutduration:3500 }, swipe : { ontouch:true, onmouse:true }, prev : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-prev"); }}, next : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-next"); }}, pagination : { container:function() { return $(this).parent().next('.carousel-pagi-btn'); }} }); $(".scrollable-default").parents(".scrollable").css("overflow","visible"); } if( $(this).parents(".tabs-default").find(".tab-box").eq(_tabindex).find(".full-scrollable-default").length > 0 ){ $(".full-scrollable-default").caroufredsel({ infinite : false, circular : false, auto : false, swipe : { ontouch:true, onmouse:true }, responsive : true, items : { visible : { min : 2, max : 8 } }, prev : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-prev"); }}, next : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-next"); }}, pagination : { container:function() { return $(this).parent().next('.carousel-pagi-btn'); }} }); //閲嶇疆楂樺害 /*$(".full-scrollable-default").parents('.caroufredsel_wrapper').css({ 'height': ($(".full-scrollable-default").find('li').outerheight()) + 'px' });*/ } }); // accordion $(".accordion").tabs(".accordion .accordion-pane", {tabs: '.accordion-handle', effect: 'slide',initialindex: 0}); $.tools.tabs.addeffect("slide", function(tabindex, done) { this.getpanes().slideup("fast").eq(tabindex).slidedown("fast"); done.call(); }); //鍥惧簱鍒囨崲 $('.pgwslideshow-gallery').pgwslideshow({ mainclassname : 'pgwslideshow-gallery pgwslideshow' }); $('.pgwslideshow-gallery-simple').pgwslideshow({ mainclassname : 'pgwslideshow-gallery-simple pgwslideshow', displaylist : false }); $('.pgwslideshow-gallery-zoom').pgwslideshow({ mainclassname : 'pgwslideshow-gallery-zoom pgwslideshow', displaycontrols : false }); //table //$(".qhd-content table tbody>tr:odd").addclass("odd-row"); //$(".qhd-content table tbody>tr:even").addclass("even-row"); $(".qhd-content table tbody>tr").hover(function(){ $(this).addclass("trhover"); },function(){ $(this).removeclass("trhover"); }); //澧炲姞鍝嶅簲寮忚〃鏍煎灞俤iv $(".qhd-content table").each(function(){ if( !$(this).parent().hasclass("table-responsive") ){ $(this).wrap("
"); } }); //宸﹀彸鎮诞 $(".fixed-left").fixed({halftop : true}); $(".fixed-right").fixed({halftop : true}); // $(".service-close-btn").click(function(){ var servicemax = $(this).parents(".service-max"), servicemin = servicemax.next(".service-min"); servicemin.show(); servicemax.hide(); }); $(".service-open-btn").click(function(){ var servicemax = $(this).prev(".service-max"), fixedelement = $(this).parents(".fixed"); $(this).hide(); servicemax.show(); }); //鍥炬爣-鍚嶇о-鍗曞垪閾炬帴 $(".link-fixed-side > ul > li").each(function(){ $(this).hover(function(){ $(this).addclass("active").find(".link-summary").show(); },function(){ $(this).removeclass("active").find(".link-summary").hide(); }); if( $(this).find('a').attr('href').indexof("#popup") != -1 ){ $(this).find('a').addclass('popup-show-btn'); } }); //寮圭獥瑙嗛 $('.fancybox-video-play').fancybox({ 'autoscale' : false, 'transitionin' : 'elastic', 'transitionout' : 'elastic', 'hideonoverlayclick': false, 'centeronscroll' : true, 'overlaycolor' : '#000', 'padding' : '5' }); //寮瑰嚭绐楀彛鍖哄煙 $("a").each(function(){ if( typeof($(this).attr('href'))!="undefined" && $(this).attr('href').indexof("#popup") != -1 ){ $(this).addclass('popup-show-btn'); } }); $('.popup-show-btn').click(function(){ $('.popup').show(); $('.popup-overlay').height($(document).height()); $('.popup-content').css({marginleft:-($('.popup-content').outerwidth()/2), margintop:-($('.popup-content').outerheight()/2)}); $('.popup-close-btn').click(function(){ $(this).parents('.popup').hide(); }); return false; }); //璁剧疆寮圭獥瑙嗛鐨勫搴? var touchwindowwidth = $(window).width(); if( touchwindowwidth < 1000 ){ $('.article-detail-fancybox').css("width", touchwindowwidth-80); } //绉诲姩绔?js var ismobile = device.mobile(), istable = device.tablet(), isiphone = device.iphone(), isipad = device.ipad(); if(ismobile || istable || isiphone || isipad){ //绉婚櫎鏂扮獥鍙f墦寮€ $('a').not('[data-mobile-target="_blank"]').removeattr('target'); } }); $(window).load(function() { //scrollable-default $(".scrollable-default").caroufredsel({ width : '100%', infinite : false, //circular : false, auto : { pauseonhover: true, timeoutduration:3500 }, swipe : { ontouch:true, onmouse:true }, prev : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-prev"); }}, next : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-next"); }}, pagination : { container:function() { return $(this).parent().next('.carousel-pagi-btn'); }} }); $(".scrollable-default").parents(".scrollable").css("overflow","visible"); //full-scrollable-default $(".full-scrollable-default").caroufredsel({ infinite : false, circular : false, auto : false, swipe : { ontouch:true, onmouse:true }, responsive : true, items : { visible : { min : 2, max : 8 } }, prev : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-prev"); }}, next : { button:function() { return $(this).parent().next('.carousel-direction').find(".carousel-next"); }}, pagination : { container:function() { return $(this).parent().next('.carousel-pagi-btn'); }} }); //閲嶇疆楂樺害 $(".full-scrollable-default").parents('.caroufredsel_wrapper').css({ 'height': ($(".full-scrollable-default").find('li').outerheight()) + 'px' }); }); $(window).bind("load resize", function() { var postlist = $(".post-list"); postlist.each(function(){ var postimg = $(this).find(".post-img"); var posttextbox = $(this).find(".post-text-box"); var posttext = $(this).find(".post-text"); var posttextsummary = $(this).find(".post-text-summary"); var postmaxheight = postimg.eq(0).height(); var summarymaxheight = 0; postimg.each(function(){ postmaxheight = $(this).height() > postmaxheight ? $(this).height() : postmaxheight; }).find("img").height( postmaxheight ); posttextbox.each(function(){ $(this).height( postmaxheight - parseint($(this).css("paddingtop")) - parseint($(this).css("paddingbottom")) ); }); posttextsummary.each(function(){ summarymaxheight = postmaxheight - $(this).prev("h2").height() - parseint($(this).prev("h2").css("marginbottom")) - parseint($(this).parent(".post-text").css("paddingbottom"))*2 - $(this).next(".post-text-detail").height() - 10; if( $(this).height() > summarymaxheight ){ $(this).height( summarymaxheight ); } }); //涓夊垪 - 鐗规畩澶勭悊绗簩鍒? if( $(this).hasclass("post-list-3col") ){ $(this).find(".post-list-item-spec").find(".post-img").css("top", postmaxheight); $(this).find(".post-list-item-spec").find(".post-text-box").css("top", -postmaxheight); } }); });