Emlog返回顶部和底部的自定义代码
1.把下列代码放到对应的模版下的main.css中#goto{position:absolute;top:610px;left:1030px}#goto#top,#goto#bottom{width:28px;height:41px;margin:5px0!important;background:url('images/goto.gif')no-repeat;display:block;text-indent:-9999px;cursor:pointer}#goto#top{background-position:00}#goto#bottom{background-position:0100%}
2.修改footer.php的信息
3. 注意红字部分换成你自己的图片和地址即可。然后大功告成,可参考本站的效果。<divid="goto"><divid="top">顶部</div><divid="bottom">底部</div></div><scripttype="text/javascript"src="<?phpechoBLOG_URL;?>include/lib/js/jquery/jquery-1.7.1.js"></script><scripttype="text/javascript">jQuery(function($){$('#top').click(function(){$('html,body').animate({scrollTop:'0px'},800);returnfalse;});$('#bottom').click(function(){$('html,body').animate({scrollTop:$('#footerbar').offset().top},800);returnfalse;});$(window).scroll(function(){$("#goto").animate({top:($(window).scrollTop()+200)+"px"},{queue:false,duration:1000})});});</script>
下一篇:mart.mn多国在线词典