Skip to content

Commit

Permalink
fit mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
makryl committed Feb 20, 2014
1 parent abf4f89 commit e184bb4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions abigimage.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@

i = openI;

t.img.stop().fadeOut(opts.fadeOut).attr('src', $(t[i]).attr('href'));
t.imgNext.attr('src', $(t[nextI()]).attr('href'));
t.imgPrev.attr('src', $(t[prevI()]).attr('href'));
t.img.stop().fadeOut(opts.fadeOut)
.removeAttr('src') // To re-fire load event if same image opened
.attr('src', $(t[i]).attr('href'));

t.overlay.fadeIn(opts.fadeIn);
t.layout.fadeIn(opts.fadeIn);
Expand All @@ -108,12 +108,16 @@
return false;
}

this.img.click(function() {
return next();
});

this.img.load(function() {
t.img.stop().fadeIn(opts.fadeIn);

// preload prev and next images after viewed images loaded
t.imgNext.attr('src', $(t[nextI()]).attr('href'));
t.imgPrev.attr('src', $(t[prevI()]).attr('href'));
});

this.img.click(function() {
return next();
});

this.prevBtnWrapper.click(function() {
Expand Down
2 changes: 1 addition & 1 deletion abigimage.jquery.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e184bb4

Please sign in to comment.