第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

不理解為什么一直提示聯(lián)系.html:23 Uncaught TypeError: Cannot set property 'onmouseover' of nul ,檢查了好多遍,不懂問題出在那塊兒,哪位大神幫忙看下,謝謝l

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>
dbhs
?? ?</title>
<style type="text/css">
div{
?? ?width:200px;
?? ?height:100px;
?? ?background-color:yellow;
?? ?border:2px solid #000;
?? ?opacity: 0.3;
?? ?filter:alpha(opacity:30);
}
</style>

<script type="text/javascript">

window.onload=function(){
?? ?var odiv =document.getElementById("div");
? odiv.onmouseover=function(){
??? startMove(odiv,'width',400);
? }
}

function startMove(obj,attr,iTarget,fn){
? clearInterval(obj.timer);
? obj.timer=setInterval(function(){
??? var icur=null;
??? if(attr=='opacity'){
????? icur=Math.round(parseFloat(getStyle(obj,attr))*100);
??? }else{
????? icur=parseInt(getStyle(obj,attr));
??? }
??? var speed=(iTarget-icur)/10;
??? speed=speed>0?Math.ceil(speed):Math.floor(speed);
??? if(icur==iTarget){
????? clearInterval(obj.timer);
????? if(fn){
????? fn();
??? }
??? }else{
????? if(attr=='opacity'){
??????? obj.style.filter='alpha(opacity:'+(icur+speed)+')';
??????? obj.style.opacity=(icur+speed)/100;
????? }else{
??????? obj.style[attr]=icur+speed+'px';
????? }
??? }

? },30)
}

function getStyle(obj,attr){
??????? if(obj.currentStyle){
??????????? return obj.currentStyle[attr];
??????? }else{
??????????? return getComputedStyle(obj,false)[attr];
??????? }
??? }
</script>
</script>
</head>
<body>
<div id="div1">

</div>
</body>
</html>

正在回答

3 回答

你的id獲取錯了var odiv =document.getElementById("div");

改成var odiv =document.getElementById("div1");

0 回復(fù) 有任何疑惑可以回復(fù)我~

我沒有這水平,只能圍觀了

0 回復(fù) 有任何疑惑可以回復(fù)我~

往上數(shù)倒數(shù)第七行多寫了一個</script>結(jié)束標簽,你看是不是這個原因

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

不理解為什么一直提示聯(lián)系.html:23 Uncaught TypeError: Cannot set property 'onmouseover' of nul ,檢查了好多遍,不懂問題出在那塊兒,哪位大神幫忙看下,謝謝l

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號