<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html?xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
<title>無標(biāo)題文檔</title>
<style??type="text/css">
*{margin:0;padding:0;}
#fuck{
top=0;
width:200px;
height:200px;
background:#00FFFF;
position:relative;
left:-200px;
}
#share{
????????????????width:?20px;
????????????????height:?50px;
????????????????background:?blue;
????????????????position:?absolute;
????????????????left:?200px;
????????????????top:75px;
????????????????
?}
</style>
</head>
<body>
<script>
window.onload=function(){
?var?fuck=document.getElementById("fuck");
?fuck.onmouseover=function(){
?outmove();
?}
?fuck.onmouseout=function(){
??inmove();?
?}
?}
?var?timer=?null;
function?outmove(){
var?fuck=document.getElementById("fuck");
clearInterval(timer);
timer=setInterval(function(){
if(fuck.offsetLeft==0){
clearInterval(timer);
}else{
fuck.style.left=fuck.offsetLeft+10+"px";
}
},30);
}
function?inmove(){
var?fuck=document.getElementById("fuck");
clearInterval(timer);
timer=?setInterval(function(){
if(fuck.offLeft==-200){
clearInterval(timer);
}else{
fuck.style.left=fuck.offsetLeft-10+"px";
}
},30)
}
</script>
<div?id="fuck">
<span?id="share">分享</span>
</div>
</body>
</html>為什么鼠標(biāo)離開后圖片就直接縮進去了,連“分享”圖片都縮進去了?為嘛?
2016-11-27
55行,if(fuck.offLeft==-200){,offsetLeft漏拼