Skip to content

Commit

Permalink
Update jquery.wmuslider.js
Browse files Browse the repository at this point in the history
load didn't fire on iOS when image was already cached
  • Loading branch information
KilianSSL committed Aug 8, 2013
1 parent 1f12d44 commit 3507b3f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions jquery.wmuslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,12 @@
var init = function() {
var slide = $(slides[currentIndex]);
var img = slide.find('img');
img.load(function() {
wrapper.show();
$this.animate({ height: slide.innerHeight() });
});
img.one('load', function() {
wrapper.show();
$this.height(slide.innerHeight());
}).each(function() {
if(this.complete) $(this).load(); // load didn't fire on iOS when image was cached
});
if (options.animation == 'fade') {
slides.css({
position: 'absolute',
Expand Down Expand Up @@ -280,4 +282,4 @@
});
}

})(jQuery);
})(jQuery);

0 comments on commit 3507b3f

Please sign in to comment.