本文共 3707 字,大约阅读时间需要 12 分钟。
css:
#shangxia{position:absolute;top:40%;left:50%;margin-left:-520px;display:block;z-index:2;}#shang{background:url(images/huadong.gif) no-repeat;position:relative;cursor:pointer;height:42px;width:32px;margin:10px 0;}#comt{background:url(images/huadong.gif) no-repeat center -45px;position:relative;cursor:pointer;height:32px;width:32px;margin:10px 0;}#xia{background:url(images/huadong.gif) no-repeat center -78px;position:relative;cursor:pointer;height:42px;width:32px;margin:10px 0;}
js:
jQuery(document).ready(function($){
$('#to_author_info a').click(function(){$('#author_avatar').hide();$('#author_info').fadeIn();});
var s= $('#shangxia').offset().top;$(window).scroll(function (){$("#shangxia").animate({top : $(window).scrollTop() + s + "px" },{queue:false,duration:500});});
var m = $('#menu').offset().top;$(window).scroll(function(){var w = $(window).scrollTop();if(w > m)$('#menu').css({position:'fixed',top:'0px'}).stop().animate({'opacity':'0.8'},400);else $('#menu').css({position:'static'}).stop().animate({'opacity':'1'},400);});$('#menu').hover(function(){ var w = $(window).scrollTop(); if(w > m){$('#menu').stop().animate({'opacity':'1'},400);}},function(){var w = $(window).scrollTop();if(w > m){$('#menu').stop().animate({'opacity':'0.8'},400);}});
$('.post-title').toggle(function(){$(this).next().slideDown(300);},function(){$(this).children("h2").children("a").text('椤甸潰杞藉叆涓€︹€?);window.location = $(this).children("h2").children("a").attr('href');});$(".post-title:first").click();
$("#tab-content ul li a,.post-title h2 a").hover(function () {$(this).stop().animate({marginLeft:"+=8"}, 250);},function () {$(this).stop().animate({marginLeft:"0"}, 150);});$('#tab-title span').click(function(){$(this).addClass("selected").siblings().removeClass();$("#tab-content > ul").slideUp('1500').eq($('#tab-title span').index(this)).slideDown('1500');});$("#menu .nav li:not(#close-sidebar)").hover(function(){$(this).stop().animate({paddingTop:"+=6"}, 240);},function(){$(this).stop().animate({paddingTop:"0"}, 120);});
$('#close-sidebar a').toggle(function(){$(this).text("ww?);$('#sidebar').hide().prev().animate({width: "960px"}, 1000);},function(){$(this).text("ww?);$('#sidebar').show().prev().animate({width: "705px"}, 800);});
$('#shang').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);});$('#xia').click(function(){$('html,body').animate({scrollTop:$('#footer').offset().top}, 800);});$('#comt').click(function(){$('html,body').animate({scrollTop:$('#comments').offset().top}, 800);});
$(".menuheader").click(function() {$(this).next().slideToggle(300);return false;});
$("#content a").mouseover(function(e){ this.myTitle = this.title; this.myHref = this.href; this.myHref = (this.myHref.length > 30 ? this.myHref.toString().substring(0,30)+"..." : this.myHref); this.title = ""; var tooltip = "<div id='tooltip'><p>"+this.myTitle+"<em>"+this.myHref+"</em>"+"</p></div>"; $('body').append(tooltip); $('#tooltip').css({"opacity":"0","top":(e.pageY+20)+"px","left":(e.pageX+10)+"px"}).animate({opacity:"0.8"}, 500);}).mouseout(function(){this.title = this.myTitle;$('#tooltip').remove();}).mousemove(function(e){$('#tooltip').css({"top":(e.pageY+20)+"px","left":(e.pageX+10)+"px"});});
$(".post-content a[href^=http://www.rayfile.com]").addClass("rayfile");$(".post-content a[href$=.zip],.post-content a[href$=.7z],.post-content a[href$=.rar]").addClass("zip");$(".post-content a[href$=.doc]").addClass("doc");$(".post-content a[href$=.pdf]").addClass("pdf");$(".post-content a[href$=.png]").addClass("png");
$('.vcard a').attr({ target: "_blank"});$('a,input[type="submit"],object').bind('focus',function(){if(this.blur){ this.blur();}});
});
转载地址:http://npje.baihongyu.com/