Sha256: 9dee9af5f6c969c67adba6fb04cc62c419d001873a1d2db08f62858fc45f67a0

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

(function ($, window, document, undefined) {
  'use strict';

  $.fn.animateCSS = function (effect, delay, callback) {
    return this.each(function () {
      var $this = $(this),
        transitionEnd = "webkitAnimationEnd oanimationend msAnimationEnd animationend",
        animated = "animated",
        visibility = "visibility",
        visible = "visible",
        hidden = "hidden";

      function run() {
        $this.addClass( animated + " " + effect);

        if ($this.css( visibility ) === hidden) {
          $this.css( visibility, visible);
        };

        if ($this.is(":" + hidden)) {
          $this.show();
        };

        $this.bind( transitionEnd, function () {
          $this.removeClass(animated + " " + effect);

          if (typeof callback === "function") {
            callback.call(this);
            $this.unbind( transitionEnd );
          };
        });
      };

      if (!delay || typeof delay === "function") {
        callback = delay;
        run();
      } else {
        setTimeout( run, delay );
      };
    });
  };
})(jQuery, window, document);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flashgrid-3.3.2 vendor/assets/javascripts/animation.js
flashgrid-3.3.1 vendor/assets/javascripts/animation.js
flashgrid-3.3.0 vendor/assets/javascripts/animation.js