Skip to content

Commit

Permalink
Making "source" and "inview" local variables - help garbage collection
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-almeida committed Sep 8, 2013
1 parent bd079f0 commit adc93d1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions jquery.unveil.js
Expand Up @@ -17,18 +17,16 @@
retina = window.devicePixelRatio > 1,
attrib = retina? "data-src-retina" : "data-src",
images = this,
loaded,
inview,
source;
loaded;

this.one("unveil", function() {
source = this.getAttribute(attrib);
var source = this.getAttribute(attrib);
source = source || this.getAttribute("data-src");
if (source) this.setAttribute("src", source);
});

function unveil() {
inview = images.filter(function() {
var inview = images.filter(function() {
var $e = $(this),
wt = $w.scrollTop(),
wb = wt + $w.height(),
Expand Down

0 comments on commit adc93d1

Please sign in to comment.