Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
P2 jQuery.animate() fixes: transparency and callback
Index: js/p2.js
===================================================================
--- js/p2.js (revision 8687)
+++ js/p2.js (working copy)
@@ -141,9 +141,10 @@
var cnt = newComment.contents();
newComment.children('li.newcomment').each(function() {
if (isElementVisible(this) && !showNotification) {
- $(this).animate({backgroundColor:'transparent'}, {duration: 1000}, function(){
- $(this).removeClass('newcomment');
- });
+ $(this).animate({backgroundColor:'transparent'}, {duration: 1000, complete: function(){
+ // jquery-color fades to white, not transparent
+ $(this).removeClass('newcomment').css({backgroundColor:''});
+ }});
}
bindActions(this, 'comment');
});
@@ -821,16 +822,17 @@
function removeYellow() {
$('li.newcomment, tr.newcomment').each(function() {
if (isElementVisible(this)) {
- $(this).animate({backgroundColor:'transparent'}, {duration: 2500}, function(){
- $(this).removeClass('newcomment');
- });
+ $(this).animate({backgroundColor:'transparent'}, {duration: 2500, complete: function(){
+ $(this).removeClass('newcomment').css({backgroundColor:''});
+ }});
}
});
if (isFirstFrontPage) {
$('#main > ul > li.newupdates').each(function() {
if (isElementVisible(this)) {
- $(this).animate({backgroundColor:'transparent'}, {duration: 2500});
- $(this).removeClass('newupdates');
+ $(this).animate({backgroundColor:'transparent'}, {duration: 2500, complete: function(){
+ $(this).removeClass('newupdates').css({backgroundColor:''});
+ }});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.