久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      js實現(xiàn)動態(tài)的“元宵節(jié)湯圓”特效(仿百度)

      模仿百度首頁“元宵節(jié)湯圓”動圖:(js的定時任務(wù):setInterval)

      原理:需要一張切圖,通過不斷定位使得圖片就像一幀一幀的圖片在播放從而形成了動畫

      效果圖:

      js實現(xiàn)動態(tài)的“元宵節(jié)湯圓”特效(仿百度)

      切圖地址:

      https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/img/1519708766000_4f5d68844a93b929405a11d217ef0bf5.png

      頁面代碼:

      <!DOCTYPE html> <%@ page language="java" contentType="text/html; charset=UTF-8"%> <%     String ctxPath = request.getContextPath();     request.setAttribute("ctxpath", ctxPath);//項目根路徑 %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="${ctxpath}/js/jquery-1.11.3.min.js"></script> <%-- <link href="${ctxpath}/css/main.css" rel="stylesheet"> --%>    <title>首頁</title> <style type="text/css">  </style> <script type="text/javascript">  $(function(){ //6210     // 0 270 540 810 1080 1890 2700 2970 3510 3780 4050 4320 5130 5940 6480 7290     // 定時任務(wù),每隔100ms執(zhí)行一次函數(shù)     setInterval("tangyuan()",100);     setInterval("tangyuan1()",100);     //setInterval("indexChange()",1); });  //湯圓 正著挖 var count = 0; function tangyuan(){     count = count - 270;     if(count == -8370){         count = 0;     }     var ctxpath = '${ctxpath}';     //url("https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/img/1519708766000_4f5d68844a93b929405a11d217ef0bf5.png")     //https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/img/1519708766000_4f5d68844a93b929405a11d217ef0bf5.png     $("#tangyuan").css("background","url("+ctxpath+"/img/baidu/baidu_tangyuan.png) "+count+"px"+" 0px no-repeat");  }  //湯圓 倒著挖 var count1 = -8370; function tangyuan1(){     count1 = count1 + 270;     if(count1 == 0){         count1 = -8370;     }     var ctxpath = '${ctxpath}';     //url("https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/img/1519708766000_4f5d68844a93b929405a11d217ef0bf5.png")     //https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/img/1519708766000_4f5d68844a93b929405a11d217ef0bf5.png     $("#tangyuan1").css("background","url("+ctxpath+"/img/baidu/baidu_tangyuan.png) "+count1+"px"+" 0px no-repeat");  } </script> </head> <body>     <span style="position: absolute;left: 30%">湯圓我要正著挖(●ˇ?ˇ●):</span>     <!-- background: url("https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/img/1519708766000_4f5d68844a93b929405a11d217ef0bf5.png") -2970px 0px no-repeat; -->     <div id="tangyuan" style="position: absolute; top: 0px; left: 50%; cursor: pointer; width: 270px; height: 129px; margin-left: -135px;" title="團團圓圓樂元宵">     </div>     <span style="position: absolute;left: 0%">湯圓我要倒著挖o(* ̄︶ ̄*)o:</span>     <!-- background: url("https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/img/1519708766000_4f5d68844a93b929405a11d217ef0bf5.png") -2970px 0px no-repeat; -->     <div id="tangyuan1" style="position: absolute; top: 0px; left: 20%; cursor: pointer; width: 270px; height: 129px; margin-left: -135px;" title="團團圓圓樂元宵">     </body> </html>

      推薦學(xué)習(xí):《javascript視頻教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號