I have written a code which makes a border of a div orange then after a second or two changes it to black, however what is actually happening is that it goes straight to black, any help please? thanks!
Code:
$('#newMessage1').css('border','2px solid #ffa800').delay(100).css('border','2px solid #000000');
The jQuery
delayfunction only works on functions added to thefxqueue (functions likefadeInorslideDown).cssis not one of these functions (try todelayany other non-fx-queue aware function and it won’t work either).From the docs:
jQuery
delayis not a substitute for the native JSsetTimeout, which in this case would probably be the way to go. You could, for example, do something like this (working example here):