abstract:图片跟随系统 *{
margin: 0;
padding: 0;
}
body{
list-style: none;
}
#nav{
width: 500px;height: 30px;background:black;margin: 0 auto;color: white;position: relative;
}
ul{
position:relative;
}
#nav ul li{
font-size: 15px;
width: 100px;
height: 30px;
line-height: 30px;
float: left;
text-align: center;
list-style: none;
cursor:pointer;
}
$(function(){
$('li').hover(
function(){
$x=parseInt($(this).attr('name'))*100
$('.block').stop().animate({left:$x+'px'},300)
},
function(){
$('.block').stop().animate({left:'0px'},300)
}
)
})
Correcting teacher:天蓬老师Correction time:2019-08-28 16:40:20
Teacher's summary:下次把代码放在代码块中, 然后配个图再提交