日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java定时器报错,定时器设置报错

發(fā)布時間:2023/12/4 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java定时器报错,定时器设置报错 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

麻煩老師看一下,報錯原因:

輪播.html:136?Uncaught?TypeError:?Cannot?set?property?'onmouseover'?of?null

at?slideImg?(輪播.html:136)

at?輪播.html:153

slideImg????@????輪播.html:136????(anonymous)????@????輪播.html:153

找了一下沒有找到解決辦法。

html>

綜合實例

*{

margin:0;

padding:0;

}

ul{

list-style:?none;

}

body{

font-family:"微軟雅黑";

color:#14191e;

}

.main{

width:1200px;

height:460px;

margin:30px?auto;

overflow:hidden;

position:relative;

}

.banner{

width:1200px;

height:460px;

overflow:hidden;

position:relative;

}

.banner-slide{

width:1200px;

height:460px;

background-repeat:?no-repeat;

position:absolute;

display:none;

}

.slide1{

background-image:url("C:/huaXiaXia/Sublime%20Text%203/教輔/實現輪播教輔/JavaScript實現輪播特效(代碼)/img/bg1.jpg");

}

.slide2{

background-image:url("C:/huaXiaXia/Sublime%20Text%203/教輔/實現輪播教輔/JavaScript實現輪播特效(代碼)/img/bg2.jpg");

}

.slide3{

background-image:url("C:/huaXiaXia/Sublime%20Text%203/教輔/實現輪播教輔/JavaScript實現輪播特效(代碼)/img/bg3.jpg");

}

.slide-active{

display:block;

}

.button{

position:absolute;

width:40px;

height:80px;

left:244px;

top:50%;

margin-top:-40px;

background-color:green;

background:?url("C:/huaXiaXia/Sublime%20Text%203/教輔/實現輪播教輔/JavaScript實現輪播特效(代碼)/img/arrow.png")?no-repeat?center?center;

}

.pre{

transform:rotate(180deg);

}

.next{

left:auto;

right:0;

}

.button:hover{

background-color:#333;

opacity:0.5;

filter:alpha(opacity:50);

}

.dots{

position:absolute;

right:20px;

bottom:24px;

text-align:right;

}

.dots?span{

display:inline-block;

width:12px;

height:12px;

border-radius:50%;

/*rbga,a為透明度*/

background:rgba(7,17,27,0.4);

/*陰影,水平?垂直?距離?模糊程度?顏色?內陰影*/

box-shadow:?0?0?0?2px?rgba(255,255,255,0.8)?inset;

margin-left:8px;

line-height:12px;

cursor:pointer;

}

.dots?span.active{

box-shadow:?0?0?0?2px?rgba(7,17,27,0.4)?inset;

background:#fff;

}

//封裝一個getElementById()的方法

function?byId(id){

return?typeof(id)?===?"string"?document.getElementById(id):id;

}

var?index=0,

timer=null,

pics=byId("banner").getElementsByTagName("div"),

len=pics.length;

function?slideImg(){

var?main=byId("main");

main.onmouseover?=?function(){

//滑過清除定時器

}

main.onmouseout?=?function(){

//setTimeout超時定時器?setInterval界限調用

timer=setInterval(function(){

index++;

if(index>=len){

index?=?0;

}

//切換圖片

//?changeImg();

console.log(index);

},2000);

}

}

slideImg();

//切換圖片

//?function?changeImg(){

//??//遍歷banner下的所有div將其隱藏

//??for(var?i=0;i

//???pics[i].style.display="none";

//??}

//??//根據index所有找到div將其顯示出來

//??pics[index].style.display='block';

//?}

總結

以上是生活随笔為你收集整理的java定时器报错,定时器设置报错的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。