當前位置:編程學習大全網 - 網站源碼 - 求高手解決js和html代碼的問題,為什麽前面加了文字後文字會移動?

求高手解決js和html代碼的問題,為什麽前面加了文字後文字會移動?

& ltdiv id = " divP " style = " position:absolute;頂部:0;"& gt& ltimg src = " 1 . png "/& gt;& lt/div & gt;& ltdiv id = " a " style = " position:absolute;top:100;”onmouseOver="mouseOver()"

onmouseOut = " mouseOut()" & gt;& lta & gt文本

& ltscript type = " text/JavaScript " & gt;

函數mouseOver(){

var a = 0;

函數move(){

a++;

if(a = = 49){ clear interval(time);}

divp . style . top =(divp . style . top . replace(' px ',' ')-0+3);

}

var time = window . setinterval(move,10);}

函數mouseOut(){

var ab = 0;

函數mov(){

a b++;

if(ab = = 49){ clear interval(time);}

divp . style . top =(divp . style . top . replace(' px ',' ')-3);

}

var time = window.setInterval(mov,10);}

& lt/script & gt;

& lt樣式類型-“文本/CSS”& gt;

# a:hover { color:red;}

& lt/style & gt;

  • 上一篇:怎麽註冊大漠插件
  • 下一篇:抖音摩天輪樂隊成員
  • copyright 2024編程學習大全網