Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highlight by coloring a div on page load (without using jQuery UI)

Tags:

jquery

I just need to highlight a div by changing its background color for just a moment on page load. I dont want to include jQuery UI plugin just for this.

Is there is any way to do this just by pure jQuery 1.4?

like image 286
Mohit Jain Avatar asked Oct 14 '22 21:10

Mohit Jain


1 Answers

$("div").addClass("highlight");
    setTimeout(function() {$("div").removeClass("highlight");}, 500);


.highlight {
      background: red;
}
like image 196
Aaron McIver Avatar answered Oct 31 '22 14:10

Aaron McIver