做网站|网站建设,就上易助科技网

前端技术文档及相关资料下载

关于前端html、css、js等技术上的各种疑难棘手问题的解决方案探讨及相关资料下载!

JQuery动画效果插件easing.js
来源:易助科技网浏览量:13收藏

简介

easing.js是一款jQuery动画效果插件,使用该插件可以实现直线匀速运功、变加速运动、缓冲等丰富的动画效果。它非常小巧,且有多种动画方式供选择,使用简单且免费。


使用

1.  引入插件:引入jQuery库文件和Easing js文件。

<script type="text/javascript" src="jquery.js"></script>  
<script type="text/javascript" src="jquery.easing.min.js"></script>


2.  示例

//css    
 .div1 {
       position: absolute;
       left: 0;
       top: 0;
      width: 100px;
      height: 100px;
      background: red;
      margin: 5px;
      cursor: pointer;
 }

  //html    
<div class="div1">示例</div>

//js 
$(".div1").click(function () {
    $(this).animate({
        width: 300
    }, {
        easing: "easeInOutBack",
        complete: function () {//回调函数
            $(this).animate({
                height: 200
            }, {
                easing: "easeOutBounce"
            })
        }
    })
});