这个怎么不动的?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>练习JS</title>
</head>
<style type="text/css">
body{
margin:0;
padding:0;
}
.div1{
width:200px;
height:140px;
background-color: red;
left: -202px;
position: relative;
}
.div1 span{
width:20px;
height: 50px;
background: #eee;
position: absolute;
left: 200px;
top:75px;
}
</style>
<body>
<div class="div1">
<span id="share">分享</span>
</div>
<script>
window.onload = function(){
var wsc = document.getElementById('div1');
wsc.onmouseover = function(){
startMove();
}
}
function startMove(){
var wsc = document.getElementById('div1');
setInterval(function(){
wsc.style.left = wsc.offsetLeft+10+'px';
},30)
}
</script>
</body>
</html>