Sha256: c4d7348229450d1593634a1b95e6cff803234af13b2eebdd8fc41839793fb5cb

Contents?: true

Size: 1.09 KB

Versions: 93

Compression:

Stored size: 1.09 KB

Contents

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

  $.fn.animateCSS = function (effect, delay, callback) {
    return this.each(function () {

      var $this       = $(this),
        animated      = "animated",
        hidden        = "hidden",
        transitionEnd = "webkitAnimationEnd oanimationend msAnimationEnd animationend",
        visibility    = "visibility",
        visible       = "visible";

      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

93 entries across 93 versions & 2 rubygems

Version Path
active_frontend-2.0.5 vendor/assets/javascripts/animation.js
active_frontend-2.0.4 vendor/assets/javascripts/animation.js
active_frontend-2.0.3 vendor/assets/javascripts/animation.js
active_frontend-2.0.2 vendor/assets/javascripts/animation.js
active_frontend-2.0.1 vendor/assets/javascripts/animation.js
active_frontend-2.0.0 vendor/assets/javascripts/animation.js
active_frontend-1.0.11 vendor/assets/javascripts/animation.js
active_frontend-1.0.10 vendor/assets/javascripts/animation.js
active_frontend-1.0.9 vendor/assets/javascripts/animation.js
active_frontend-1.0.8 vendor/assets/javascripts/animation.js
active_frontend-1.0.7 vendor/assets/javascripts/animation.js
active_frontend-1.0.6 vendor/assets/javascripts/animation.js
active_frontend-1.0.5 vendor/assets/javascripts/animation.js
active_frontend-1.0.4 vendor/assets/javascripts/animation.js
active_frontend-1.0.3 vendor/assets/javascripts/animation.js
active_frontend-1.0.2 vendor/assets/javascripts/animation.js
active_frontend-1.0.1 vendor/assets/javascripts/animation.js
active_frontend-1.0.0 vendor/assets/javascripts/animation.js
flashgrid-4.0.7 vendor/assets/javascripts/animation.js
flashgrid-4.0.6 vendor/assets/javascripts/animation.js