如何使用jQuery淡化背景图像? [英] How do I fade background images using jQuery?
本文介绍了如何使用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.
如何使用jQuery淡化背景图像?
How do I fade background images using jQuery?
我需要一个jQuery插件吗?
Is there a jQuery plugin that I need?
推荐答案
可能有可用的东西,但是应该容易地从以下几部分进行组合:
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
andfadeOut
to change the opacity of an element. - Create a div with
position:absolute
and put two images inside it withposition:relative
. This will make the images stack on top of each other
这篇关于如何使用jQuery淡化背景图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文