voici mon javascript:addClass travail ne marche pas, dévers define (ce)
$(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");
});
});
et mon 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>
ne peut pas ajouter la classe à un lien dont l'attribut rel est la même chose avec embed src attribute ... jquery est ajouté ... pls smb help!
Nick Craver, biiig mec thx! m'a vraiment aidé! –
@venom, alors vous voudrez peut-être envisager de voter et/ou d'accepter la réponse =) –
Nick Craver, 4 minutes restantes) mais il y a un problème ... savez-vous comment ajouter la classe à une image plutôt que à un lien a? –