jquery-fly-rails

Add to cart - animation effect


Keywords
javascript-library, ruby-gem
License
MIT
Install
gem install jquery-fly-rails -v 1.0.0

Documentation

Jquery-Fly-Rails Gem Version

Add to cart - animation effect rails wrap.

Installation

Add this line to your application's Gemfile:

gem 'jquery-fly-rails'

And then execute:

$ bundle

How to use

jQuery(function($) {
  $('#fly').fly({
    start:{
      left: 11,  //开始位置(必填)#fly元素会被设置成position: fixed
      top: 600,  //开始位置(必填)
    },
    end:{
      left: 500, //结束位置(必填)
      top: 130,  //结束位置(必填)
      width: 100, //结束时高度
      height: 100, //结束时高度
    },
    autoPlay: false, //是否直接运动,默认true
    speed: 1.1, //越大越快,默认1.2
    vertex_Rtop:100, //运动轨迹最高点top值,默认20
    onEnd: function(){} //结束回调
  });
  $('#fly').play(); //autoPlay: false后,手动调用运动
  $('#fly').destroy(); //移除dom
});

Or check official demo