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

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

放源碼(速度動畫)

<!DOCTYPE html>
<html>
<head>
??? <meta charset="UTF-8">
??? <title></title>

??? <style type="text/css">
??????? *{
??????????? margin:0;
??????????? padding:0;
??????? }
.frameworks{
position:fixed;
??? top:30%;
}

?????? .frameworks span{
?????????? width:20px;
??????????? height:50px;
??????????? position:absolute;
??????????? border:1px #8e8e8e solid;
??????????? color:#fff;
??????????? background-color: #0088bb;
??????????? left: 200px;
??????????? top: 75px;



??????? }
?????? .content{
??????????? width:200px;
??????????? height:200px;
??????????? background-color: #8e8e8e;
??????????? position:relative;
??????????? left:-200px;

??????? }
??? </style>

</head>
<body>
<div>

??? <div id="div1">
??? <span>分享</span>
??? </div>
</div>

</body>
<script type="text/javascript">
window.onload = function(){
??? var odiv = document.getElementById("div1");
??? odiv.onmouseover=function(){

??????? startMove(0);
??? };
??? odiv.onmouseout=function(){

??????? startMove(-200);
??? };
};
var timer=null;
??? function startMove(iTarget){
??????? clearInterval(timer);
??????? var odiv = document.getElementById("div1");
??????????? timer = setInterval(function () {
??????????????? if(odiv.offsetLeft>iTarget){
??????????????????? speed = -10;
??????????????? }else{
??????????????????? speed = 10;
??????????????? }
??????????????? if(odiv.offsetLeft == iTarget){
??????????????????? clearInterval(timer)
??????????????? }else {
??????????????????? odiv.style.left = odiv.offsetLeft + speed + 'px'
??????????????? }
??????????? }, 20)

??? }

</script>
</html>

正在回答

1 回答

1、CSS樣式中冗余代碼好多,差評;

2、JS對象的命名沒有規(guī)則章法,差評。

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

舉報

0/150
提交
取消
JS動畫效果
  • 參與學習       113920    人
  • 解答問題       1487    個

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

進入課程

放源碼(速度動畫)

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

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

幫助反饋 APP下載

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

公眾號

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