这是我的javascript:
$(function() {
$(".image2").click(function() {var image = $(this).attr("rel");
$('#image2').hide();
$('#image2').fadeIn('slow');
$('#image2').html('<embed height="253" width="440" wmode="transparent" src="' + image + '"></embed>');
return false;
});
});
$(document).ready(function() {
$("#thumb2 a").each(function() {
var image = $('#image2 embed').attr('src');alert(image);
if(this.attr('rel') = image )
$(this).addClass("open");
});
});
和我的html:
<style>
#thumb2 img { border:1px solid #dfdfdf; padding:3px; height:29px; margin-top:5px; opacity:0.3; }
#thumb2 img:hover { border:1px solid #fc7200; opacity:1.0; }
.image2.open { border:1px solid #fc7200; opacity:1.0; }
</style>
<div id="image2"><embed height="253" width="440" wmode="transparent" src="images/kameralar.swf"></embed></div>
<div id="thumb2">
<a href="#" rel="images/kameralar.swf" class="image2" ><img src="images/t1.png" border="0"/></a>
<a href="#" rel="images/standalone.swf" class="image2"><img src="images/t2.png" border="0"/></a>
<a href="#" rel="images/mobil.swf" class="image2"><img src="images/t3.png" border="0"/></a>
<a href="#" rel="images/3b2.swf" class="image2"><img src="images/t4.png" border="0"/></a>
<a href="#" rel="images/canon.swf" class="image2"><img src="images/t5.png" border="0"/></a>
<a href="#" rel="images/indigovision.swf" class="image2"><img src="images/t6.png" border="0"/></a>
</div>
无法将类添加到其 rel 属性与 embed src 属性相同的链接...添加了 jquery...请 smb 帮助!