为什么审查元素的时候点击不了审查元素中代码,感觉卡住了
<!doctype html>
<head>
<meta charset="gb2312">
<title>ฑไปฏ</title>
</head>
<style>
*{margin:0px; padding:0px;}
li{ width:200px; height:100px; background:red; margin-bottom:20px;}
</style>
<script>
window.onload=function(){
var Li1=document.getElementById('div1');
var Li2=document.getElementById('div2');
Li1.onmouseover=function(){
startMove(this,'width',400);
}
Li1.onmouseout=function(){
startMove(this,'width',200);
}
Li2.onmouseover=function(){
startMove(Li2,'height',300);
}
Li2.onmouseout=function(){
startMove(Li2,'height',100);
}
}
function getStyle(set,attr){
if(set.currentStyle){
return set.currentStyle[attr];
}else{
return getComputedStyle(set,false)[attr];
}
}
var timer=null;
function startMove(set,attr,obj,fn){
clearInterval(set.timer);
set.timer=setInterval(function(){
var curr=parseInt(getStyle(set,attr));
var speed=(obj-curr)/8;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(obj==curr){
setInterval(set.timer);
if(fn){
fn();
}
}else{
set.style[attr]=curr+speed+'px';}
},30)
}
</script>
<body>
<ul>
<li id='div1'></li>
<li id='div2'></li>
</ul>
</body>
</html>