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

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

請(qǐng)問(wèn)下大神代碼中的 alpha += speed;是什么意思?

?<style type="text/css">
??????? * {
??????????? margin: 0px;
??????????? padding: 0px;
??????? }

??????? div {
??????????? position: relative;
??????????? width: 200px;
??????????? height: 200px;
??????????? background-color: red;
??????????? filter: alpha(opacity:30);
??????????? opacity: 0.3;
??????????? margin: 0 auto;
??????? }

??????? /*span {
??????????? position: absolute;
??????????? width: 20px;
??????????? height: 50px;
??????????? background-color: blue;
??????????? left: 200px;
??????????? top: 75px;
??????????? font-weight: bold;
??????????? cursor: pointer;
??????? }*/
??? </style>

??? <script>
??????? window.onload = function () {
??????????? var odiv = document.getElementById('div1');
??????????? odiv.onmouseover = function () {
??????????????? startMove(100);
??????????? }

??????????? odiv.onmouseout = function () {
??????????????? startMove(30);
??????????? }
??????? }
??????? var timer = null;
??????? var alpha = 30;
??????? function startMove(iTarget) {
??????????? clearInterval(timer);
??????????? timer = setInterval(function () {
??????????????? var odiv = document.getElementById('div1');
??????????????? var speed = 0;
??????????????? if (alpha > iTarget) {
??????????????????? speed = -10;
??????????????? } else {
??????????????????? speed = 10;
??????????????? }

??????????????? if (alpha == iTarget) {
??????????????????? clearInterval(timer);
??????????????? }
??????????????? else {
??????????????????? alpha += speed;
??????????????????? odiv.style.opacity = alpha / 100;
??????????????? }

??????????? }, 30);
??????? }

??? </script>

正在回答

2 回答

alpha = alpha + speed; 表示如果當(dāng)前運(yùn)動(dòng)未結(jié)束,就加上speed值,直到運(yùn)動(dòng)結(jié)束。

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

瘋狂的boy 提問(wèn)者

我懂了,謝謝
2016-12-03 回復(fù) 有任何疑惑可以回復(fù)我~

alpha = alpha + speed;

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

舉報(bào)

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

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

進(jìn)入課程

請(qǐng)問(wèn)下大神代碼中的 alpha += speed;是什么意思?

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

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

幫助反饋 APP下載

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

公眾號(hào)

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