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

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

完成(緩沖運(yùn)動(dòng)動(dòng)畫)

<!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 () {//這段代碼定義了速度變化的函數(shù)
???????? var speed=(iTarget-odiv.offsetLeft)/20;/*速度和距離成正比*/
??????????? speed = speed>0?Math.ceil(speed)/*向上取整*/:Math.floor(speed);/*向下取整*/
??????????? if(odiv.offsetLeft == iTarget){
??????????????? clearInterval(timer)
??????????? }else {
??????????????? odiv.style.left = odiv.offsetLeft + speed + 'px'
??????????? }
??????? }, 20)

??? }

</script>
</html>

正在回答

1 回答

沒(méi)什么問(wèn)題的話我就來(lái)掙點(diǎn)積分!

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

舉報(bào)

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

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

進(jìn)入課程

完成(緩沖運(yùn)動(dòng)動(dòng)畫)

我要回答 關(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)