為什么審查元素的時(shí)候點(diǎn)擊不了審查元素中代碼,感覺(jué)卡住了
<!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>