Is it possible to change the color that the jQuery highlight effect fade's to?
Right now it starts the highlight at yellow, then fades to white and then fades out.
I ultimately what to highlight the background color with yellow, then just fade to transparent.
I've just come across this behavior as well in jQuery UI 1.8.9, it seems to be a bug.
The way around it for me was to define the background color of the element I was highlighting in the CSS instead of letting it default to transparent.
If the background color isn't set (i.e. it is transparent), assuming you haven't changed the highlight color, then it will fade the element to yellow then to white and then fade out.
However, if you set the background color of the element you are highlighting it will fade to yellow then to the element's original color when you highlight it.
$("#id").effect( "highlight",{color:'#FFFF00',easing:'easeInElastic'},4000 );
In the options object for effect, you can change the default property of color to whatever you want. My element isn't set to a color and it highlights bright yellow, then fades back to nothing. I'm using jQuery 1.8.1 and jQuery-UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With