使用方法由 ChasonMa 提供
引入样式 style.css:
<link rel="stylesheet" href="css/style.css" type="text/css" />
引入 jquery文件:
<script src="js/jquery-2.0.3.min.js" type="text/javascript"></script>
<script type="text/javascript"> $(document).ready(function(){ $(".side ul li").hover(function(){ $(this).find(".sidebox").stop().animate({"width":"124px"},200).css({"opacity":"1","filter":"Alpha(opacity=100)","background":"#ae1c1c"}) },function(){ $(this).find(".sidebox").stop().animate({"width":"54px"},200).css({"opacity":"0.8","filter":"Alpha(opacity=80)","background":"#000"}) }); }); //回到顶部 function goTop(){ $('html,body').animate({'scrollTop':0},600); } </script>