$(function(){ var timesnav; $(".nav li").hover(function() { var li = $(this), dl = $(this).find("dl"); $(this).addClass("hover"); if (dl.length > 0) { clearTimeout(timesnav); if (dl.is(":hidden")) { $(".nav li dl").hide(); dl.stop(true,true).slideDown(400); $(".nav-bg").stop(true,true).slideDown(400); if (dl.attr("data-postinok") == null) { li.find("dl dd i").css('left', (li.width() / 2 - 6) + 'px'); var a = dl.offset().left - $(".nav").offset().left, b = dl.outerWidth(), z = $(".nav").outerWidth(); if (a + b > z) { var py = b - (z - a); dl.css({ 'left': -(py) + 'px' }); li.find("dl dd i").css('left', py + (li.width() / 2 - 6) + 'px') } dl.attr("data-postinok", 1) } } } }, function() { $(".nav li").removeClass("hover"); $(".nav-bg").stop(true,true).slideUp(200); var dl = $(this).find("dl"); timesnav = setTimeout(function() { dl.hide() }, 0) }); $('.header').scrollToFixed(); jQuery(".fullSlide").hover(function(){ jQuery(this).find(".prev,.next").stop(true,true).fadeTo("show",0.5) },function(){ jQuery(this).find(".prev,.next").fadeOut() }); jQuery(".fullSlide").slide({ titCell:".hd ul", mainCell:".bd ul", effect:"fold", autoPlay:true, autoPage:true, trigger:"click", startFun:function(i){ var curLi = jQuery(".fullSlide .bd li").eq(i); if( !!curLi.attr("_src") ){ curLi.css("background-image",curLi.attr("_src")).removeAttr("_src") } } }); if ($('.focusBox').length > 0) { jQuery(".focusBox").slide({ titCell:".focusBox-num li", mainCell:".focusBox-pic",effect:"fold", autoPlay:true,trigger:"click", startFun:function(i){ jQuery(".focusBox-txt li").eq(i).animate({"bottom":0}).siblings().animate({"bottom":-36}); } }) } if($('.fixeSidebar').length){ $('.fixeSidebar-qrcode').hover(function(){ jQuery(".fixeSidebar-qrcode-box").stop().show().animate({ opacity: 1, left:'-160' },500); },function(){ jQuery(".fixeSidebar-qrcode-box").stop().animate({ opacity: 0, left:'-140' },500,function(){ $(this).hide(); }); }); jQuery(".scrollTop").on('click',function() { jQuery("html, body").animate({ scrollTop: 0 }, 300); return false; }) } $(".StranBody").click( function () { StranBody(); }) })