我有一个jQuery的错误,我一直在寻找的时间,我想不出有什么错...... 我有这样的代码:jQuery在淡入淡出之后改变了,但是在之前的src淡入淡出!
$(document).ready(function(){
$('#ulPhotos a').click(function() {
var newSrc= $(this).find('img').attr('src').split("/");
bigPictureName = 'big'+newSrc[2];
$('#pho').hide();
$('#imageBig').attr("src", "images/photos/"+bigPictureName);
$('#pho').fadeIn('slow');
var alt = $(this).find('img').attr('alt');
$('#legend').html(alt);
});
});
,这在HTML:
<ul id="ulPhotos">
<li><a href="#centre"><img src="images/photos/09.jpg" title="La Reine de la Nuit au Comedia" alt="<em>La Reine de la Nuit</em> au Comedia"/></a>
<a href="#centre"><img src="images/photos/03.jpg" title="Manuelita, La Périchole à l’Opéra Comique" alt="Manuelita, <em>La Périchole</em> à l’Opéra Comique" /></a></li>
<li><a href="#centre" ><img src="images/photos/12.png" title="" alt="Marion Baglan Carnac Ré" /></a>
,这在bigImage:
</div>
<div id="pho" a name="centre">
<p id="legend"> La Reine de la Nuit</p>
<img src="images/photos/big09.jpg" alt="Marion Baglan" id="imageBig"/>
</div>
它只是改变了我的img在一个名为pho的div中的源...但是有时当新图像太重时,fadeIn会在之前的src上执行!所以我们先在前一张图片上看到淡入淡出,然后右侧图片显示为淡入淡出。
我错过了什么吗?
PS:页面在这里http://www.marion-baglan.net/photos.htm#centre如果单击快,你可以看到它......当我试图把一些大的照片,这是非常明显的...