Moshe
Moshe

Reputation: 58067

How do I fade background images using jQuery?

I want to have the background image change form one to another and fade in the process. Consider this for a mouseover/mouseout situation.

How do I fade background images using jQuery?

Is there a jQuery plugin that I need?

Upvotes: 1

Views: 1038

Answers (1)

Marius
Marius

Reputation: 58911

There might be something available, but it should be easy to put together from the following parts:

  • Use the hover pseudo event to check when the mouse enters and leaves an element.
  • Use fadeIn and fadeOut to change the opacity of an element.
  • Create a div with position:absolute and put two images inside it with position:relative. This will make the images stack on top of each other

Upvotes: 1

Related Questions