Sha256: 2f441839a30400536a7929981076ef3a81faf302fdfef53922dad563c13e8af8

Contents?: true

Size: 945 Bytes

Versions: 50

Compression:

Stored size: 945 Bytes

Contents

/**
 * jQuery Unveil
 * A very lightweight jQuery plugin to lazy load images
 * http://luis-almeida.github.com/unveil
 *
 * Licensed under the MIT license.
 * Copyright 2013 Luís Almeida
 * https://github.com/luis-almeida
 */

;(function($){$.fn.unveil=function(threshold,callback){var $w=$(window),th=threshold||0,retina=window.devicePixelRatio>1,attrib=retina?"data-src-retina":"data-src",images=this,loaded;this.one("unveil",function(){var source=this.getAttribute(attrib);source=source||this.getAttribute("data-src");if(source){this.setAttribute("src",source);if(typeof callback==="function")callback.call(this);}});function unveil(){var inview=images.filter(function(){var $e=$(this),wt=$w.scrollTop(),wb=wt+$w.height(),et=$e.offset().top,eb=et+$e.height();return eb>=wt-th&&et<=wb+th;});loaded=inview.trigger("unveil");images=images.not(loaded);}$w.scroll(unveil);$w.resize(unveil);unveil();return this;};})(window.jQuery||window.Zepto);

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
wrgem-0.0.32 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.31 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.30 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.29 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.28 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.27 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.26 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.25 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.24 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.23 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.22 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.21 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.20 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.19 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.18 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.17 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.15 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.14 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.13 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js
wrgem-0.0.12 lib/generators/wrstart/template/vendor/assets/components/unveil/jquery.unveil.min.js