好吧,写这篇文章主要是为了刷一下存在感的,有是小半月没更新了,发生了很多事,让人无力吐槽;俗话说,好像不是俗话,人艰不拆......
为博客添加带微博按钮返回顶部效果,具体效果如下

html代码部分
<div id="share"> <a id="totop" title="">返回顶部</a> <a href="http://weibo.com/shenghao2011" target="_blank" class="sina">新浪微博</a> <a href="http://t.qq.com/shenghao_liu" target="_blank" class="tencent">腾讯微博</a> </div>
Js代码部分
//scrolltotop
$(function(){
//首先将#back-to-top隐藏
$("#totop").hide();
//当滚动条的位置处于距顶部100像素以下时,跳转链接出现,否则消失
$(function () {
$(window).scroll(function(){
if ($(window).scrollTop()>100){
$("#totop").fadeIn();
}
else
{
$("#totop").fadeOut();
}
});
//当点击跳转链接后,回到页面顶部位置
$("#totop").click(function(){
$('body,html').animate({scrollTop:0},500);
return false;
});
});
});
css代码部分
/*share_start*/
#share {position:fixed;_position:absolute;_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight)-34+"px");bottom:34px;left:95%;width:30px;zoom:1;}
#share a{background-image:url(images/share.png); background-repeat:no-repeat; display:block; width:30px; height:30px; margin-bottom:2px; overflow:hidden; text-indent:-999px;-webkit-transition: all 0.2s ease-in-out;-moz-transition: all 0.2s ease-in-out;-o-transition: all 0.2s ease-in-out;-ms-transition: all 0.2s ease-in-out;transition: all 0.2s ease-in-out;}
#share a{}
#share .sina {background-position:0 0; position:absolute; bottom:32px;}
#share a.sina:hover { background-position:-30px 0;}
#share .tencent { background-position:0 -30px; position:absolute; bottom:0;}
#share a.tencent:hover { background-position:-30px -30px;}
#share a#totop{background-position:0 -120px;position:absolute;bottom:64px;cursor:pointer;}
#share a#totop:hover {background-position:-30px -120px;}
/*share_end*/
其他具体CSS细节请自行调节,当然页面引入jquery.js时必须的,搞定收工。
最后放一个演示地址:Demo
返回顶部了哈。。 :happy:
看了404,确实很牛逼
404页面挺牛逼,决定搬走 :pen:
样式不错,学学放些别的东西,哈哈
小白路过,都不知道放在哪个文件里面,请教下
footer.php里,js文件你当然js文件里面。css放样式表里。