2012-02-23 35 views
0

我有一个800x500的图像。底部的两个象限有编辑,我想淡入图形。jquery淡入,图像在图像

如果整幅图像组成的 AB CD

Ç& d是10秒后究竟会被覆盖了两张图片是适合底部象限。我开始显示:无;认为fadein()会照顾到这一点,但我已经搞砸了。

小提琴是here我用不同的图像,但大小是正确的。

的style.css

*{ 
    margin:0; 
    padding:0; 
    background-color: #000; 
} 

#container { 
    position: absolute; 
    bottom: 0px; 
    top: 0px; 
    display:inline;    
} 

.bottom-left { 
    position:absolute; 
    top:250px; 
    left: 0px; 
    display: none; 
} 

.bottom-right { 
    position:absolute; 
    top:250px; 
    left:400px; 
    display: inline; 

} 

页:

<!DOCTYPE html> 
<html> 
<head> 

<!-- STYLE SHEETS --> 
     <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/> 

<!-- JQuery * QTip Plugin at the bottom --> 
     <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> 


<script type="text/javascript"> 
    $(document).ready(function(){ 
     $('#bottom-left').fadeIn(10000); 
    }); 
</script> 

</head> 
<body> 
<div id="container"> 

<image src="images/NoAlertFull.png"> 
     <span class="bottom-right"> 
       <image src="images/Alert-red.png"> 
     </span> 
     <span class="bottom-left"> 
       <image src="images/Alert-yellow.png"> 
     </span>  
</div> 

</body> 
</html> 

回答

1

你adressing通过ID的跨度,而不是通过类:改变选择到

$('.bottom-left').fadeIn('slow'); 
1

自下而上左边是你的班级名称。所以以点

$('.bottom-left').fadeIn(1000); 

这里使用它是在样品:http://jsfiddle.net/CwgyW/5/

http://api.jquery.com/class-selector/

如果您尝试使用id来获取元素,使用#

Ex : $("#myDivId").fadeIn(3000); 

如果您尝试使用类名获得元素,使用点

Ex : $(".myCSSClassName").fadeIn(3000); 
1

您使用id选择器#bottom-left而不是类别选择器.bottom-left

此外,jsfiddle拥有自己的文档大纲,不会粘贴整个页面,只是正文内容。

演示:http://jsfiddle.net/Guffa/CwgyW/6/

1
$('#bottom-left').fadeIn(10000); 

应该是

$('.bottom-left').fadeIn(10000); 

#是用于通过选择ID

.是用于通过

类选择