亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jQuery拋物線運(yùn)動(dòng)實(shí)現(xiàn)方法(附完整demo源碼下載)

 更新時(shí)間:2016年01月08日 11:05:42   作者:愚人碼頭  
這篇文章主要介紹了jQuery拋物線運(yùn)動(dòng)實(shí)現(xiàn)方法,以完整實(shí)例形式分析了jQuery物體運(yùn)動(dòng)的實(shí)現(xiàn)技巧,并附帶了完整的demo源碼供讀者下載參考,需要的朋友可以參考下

本文實(shí)例講述了jQuery拋物線運(yùn)動(dòng)實(shí)現(xiàn)方法。分享給大家供大家參考,具體如下:

運(yùn)行效果截圖如下:

點(diǎn)擊此處查看在線演示效果。

完整實(shí)例代碼點(diǎn)擊此處本站下載。

具體代碼如下:

<!DOCTYPE HTML>
<html>
<head>
 <meta charset="utf-8">
 <title>拋物線運(yùn)動(dòng)效果</title>
 <style type="text/css">
  .boll {
   width: 50px;
   height: 50px;
   background-color: #ff3333;
   position: absolute;
   top: 380px;
   left: 100px;
   -moz-border-radius: 50px;
   -webkit-border-radius: 50px;
   border-radius: 50px;
  }
  .target {
   width: 50px;
   height: 50px;
   background-color: #CDCDCD;
   position: absolute;
   top: 180px;
   left: 600px;
   -moz-border-radius: 50px;
   -webkit-border-radius: 50px;
   border-radius: 50px;
  }
 </style>
 <script type="text/javascript" src="js/jquery1.8.3.min.js"></script>
 <script type="text/javascript" src="js/parabola.js"></script>
</head>
<body>
 <div class="btns" style="margin-top:20px">
 <a href="#" class="btnA btn-danger" id="reset" rel="popover" title="A Title" style="">reset</a>
 <a href="#" class="btnA btn-danger" id="run" rel="popover" title="A Title" style="">run</a>
 <a href="#" class="btnA btn-danger" id="stop" rel="popover" title="A Title" style="">stop</a>
 <a href="#" class="btnA btn-danger" id="setOptions" rel="popover" title="A Title" style="">setOptions</a>
</div>
<div id="boll" class="boll"></div>
<div id="target" class="target"></div>
<script type="text/javascript">
 var bool = new Parabola({
  el: "#boll",
  offset: [500, 100],
  curvature: 0.005,
  duration: 3000,
  callback:function(){
   alert("完成后回調(diào)")
  },
  stepCallback:function(x,y){
   console.log(x,y);
   $("<div>").appendTo("body").css({
    "position": "absolute",
    "top": this.elOriginalTop + y,
    "left":this.elOriginalLeft + x,
    "background-color":"#CDCDCD",
    "width":"5px",
    "height":"5px",
    "border-radius": "5px"
   });
  }
 });
 $("#reset").click(function (event) {
  event.preventDefault();
  bool.reset()
 });
 $("#run").click(function (event) {
  event.preventDefault();
  bool.start();
 });
 $("#stop").click(function (event) {
  event.preventDefault();
  bool.stop();
 });
 $("#setOptions").click(function (event) {
  event.preventDefault();
  bool.setOptions({
   targetEl: $("#target"),
   curvature: 0.001,
   duration: 1000
  });
 });
</script>
</body>
</html>

更多關(guān)于JavaScript運(yùn)動(dòng)效果相關(guān)內(nèi)容可查看本站專題:《JavaScript運(yùn)動(dòng)效果與技巧匯總

希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論