jQuery的背景图片"淡入"动画 [英] jQuery background-image "fade in" animation
问题描述
可能有人帮帮我吗?我有一个设置为背景,以身体元素图像的网站。我需要建立像淡出的效果。
Could somebody please help me? I have a site with an image set as background to the "body" element. I need to create an effect like "fade in".
这是该网站的 http://www.ladycup.eu/ 。
如果您缩小,你可以看到的主要内容包装盒侧面的叶子。这是形象,我需要它从内容框下的成长如果你知道我的意思。我对这个话题读过很多建议 - 如创建与背景,等等这一形象一个div但在这种情况下,我不能这样做。我会很感激任何帮助...
If you zoom out, you can see the leaves on the side of the main content box. That is the image and I need it to "grow" from under the content box if you know what I mean. I have read much advice on this topic - like creating a div with this image in the background, etc. but in this case I can't do that. I would be really grateful for any help...
推荐答案
我查了网站,但我看不到车身,背景,无论如何,如果我得到你的问题,你想要的背景图片身体淡出和成长的内容以上,如果是这样,
I've checked the site, but I couldn't see the background of the body, anyway, If I got your question, you want the background image of the body to fade out and grow above the content, if so,
使用CSS3,定义一个类,并调用它,你什么都想要,我们称之为ANI
Using CSS3, define a class and call it what ever you want, let's call it ani
.ani {
-moz-transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
和你HTML code这个类补充人体<体类=ANI>
and in you HTML code add this class to the body <body class="ani">
最后一件事,背景补充人体,并在负荷变化的不透明度
Last thing, add the background to the body, and on load change the opacity
<script>
$(document).ready(function(){
$('#Body').css('opacity', 0.1);
});
</script>
这篇关于jQuery的背景图片&QUOT;淡入&QUOT;动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!