最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

請問下大神代碼中的 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)動未結(jié)束,就加上speed值,直到運(yùn)動結(jié)束。

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

瘋狂的boy 提問者

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

alpha = alpha + speed;

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

舉報(bào)

0/150
提交
取消
JS動畫效果
  • 參與學(xué)習(xí)       113911    人
  • 解答問題       1502    個

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

進(jìn)入課程

請問下大神代碼中的 alpha += speed;是什么意思?

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

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

幫助反饋 APP下載

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

公眾號

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