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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

這個(gè)怎么不動(dòng)的?

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>練習(xí)JS</title>

</head>

<style type="text/css">

body{

margin:0;

padding:0;

}

.div1{

width:200px;

height:140px;

background-color: red;

left: -202px;

? ? position: relative;

}

.div1 span{

width:20px;

? ? height: 50px;

? ? background: #eee;

? ? position: absolute;

? ? left: 200px;

? ? top:75px;

}

</style>

<body>

<div class="div1">

<span id="share">分享</span>

</div>

<script>

window.onload = function(){

var wsc = document.getElementById('div1');

wsc.onmouseover = function(){

startMove();

}

}

function startMove(){

var wsc = document.getElementById('div1');

setInterval(function(){

wsc.style.left = wsc.offsetLeft+10+'px';

},30)

}

</script>

</body>

</html>


正在回答

2 回答

<!DOCTYPE?html>
<html>
<head>
????<meta?charset="utf-8">
????<title>練習(xí)JS</title>
</head>
<style?type="text/css">
????body{
????????margin:0;
????????padding:0;
????}
????#div1{
????????width:200px;
????????height:140px;
????????background-color:?red;
????????left:?-202px;
????????position:?relative;
????}
????#div1?span{
????????width:20px;
????????height:?50px;
????????background:?#eee;
????????position:?absolute;
????????left:?200px;
????????top:75px;
????}
</style>
<body>
<div?id="div1">
????<span?id="share">分享</span>
</div>
<script>
????window.onload?=?function(){
????????var?wsc?=?document.getElementById('div1');
????????wsc.onmouseover?=?function(){
????????????startMove();
????????}
????}
????function?startMove(){
????????var?wsc?=?document.getElementById('div1');
????????setInterval(function(){
????????????wsc.style.left?=?wsc.offsetLeft+10+'px';
????????},30)
????}
</script>
</body>
</html>

你上面寫(xiě)的class ?你下面用getElementById 去取,肯定取不到呀

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

吳思超0 提問(wèn)者

非常感謝!
2015-12-10 回復(fù) 有任何疑惑可以回復(fù)我~

原來(lái)是getElementById只能獲取ID類(lèi)的。謝謝了

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

舉報(bào)

0/150
提交
取消
JS動(dòng)畫(huà)效果
  • 參與學(xué)習(xí)       113920    人
  • 解答問(wèn)題       1500    個(gè)

通過(guò)本課程JS動(dòng)畫(huà)的學(xué)習(xí),從簡(jiǎn)單動(dòng)畫(huà)開(kāi)始,逐步深入各種動(dòng)畫(huà)框架封裝

進(jìn)入課程

這個(gè)怎么不動(dòng)的?

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

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

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

公眾號(hào)

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