jquery - Javascript on scroll event change css then wait and then rechange -


i trying change css on scroll event , working.

$(window).scroll(function () {     $(".navcont").css("background-color", "pink") }); 

but, when try give delay , change back,

$(window).scroll(function () {     $(".navcont").css("background-color", "pink")         .delay( 5000 )         .css("background-color", "white"); }); 

it shows pink color, want white color first delay , pink color.

can 1 me this! in advance

try using settimeout, without animate:

$(window).scroll(function () {     $(".navcont").css("background-color", "pink");     settimeout(function() {$(".navcont").css("background-color", "white")}, 8000); }); 

here on jsfiddle.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -