Skip to content

Commit

Permalink
fade mode now sets panel visibility when resumeOnVisible is true. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Oct 4, 2013
1 parent ed3e55c commit 2a1b462
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions js/jquery.anythingslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
t = base.$items.eq(base.currentPage-1);
if (o.resumeOnVisible) {
// prevent display: none;
t.css({ opacity: 1 }).siblings().css({ opacity: 0 });
t.css({ opacity: 1, visibility: 'visible' })
.siblings().css({ opacity: 0, visibility: 'hidden' });
} else {
// allow display: none; - resets video
base.$items.css('opacity',1);
Expand Down Expand Up @@ -677,11 +678,22 @@
};

base.fadeIt = function(el, toOpacity, time, callback){
var t = time < 0 ? 0 : time;
var f = el.filter(':not(:animated)'),
t = time < 0 ? 0 : time;
if (o.resumeOnVisible) {
el.filter(':not(:animated)').fadeTo(t, toOpacity, callback);
if (toOpacity === 1) {
f.css('visibility', 'visible');
}
f.fadeTo(t, toOpacity, function(){
if (toOpacity === 0) {
f.css('visibility', 'hidden');
}
if ($.isFunction(callback)) {
callback();
}
});
} else {
el.filter(':not(:animated)')[ toOpacity === 0 ? 'fadeOut' : 'fadeIn' ](t, callback);
f[ toOpacity === 0 ? 'fadeOut' : 'fadeIn' ](t, callback);
}
};

Expand Down

0 comments on commit 2a1b462

Please sign in to comment.