我在網站中使用PrettyPhoto。它顯示單擊圖像時的內聯內容。jQuery:click()函數不適用於PrettyPhoto
<a href="#verObra" rel="prettyPhoto">Work name.</a>
內聯要顯示的內容是:
<div id="verObra1" class="verObra">
<div class="galObra">
<div id="imgAmpliada">
<img src="images/showObra.jpg" alt="" />
</div><!-- /#Ampliada -->
<ul class="thumbs">
<li><a href="#" rel="prettyPhoto[pp_gal]"><img src="images/thumb.jpg" alt=""/></a>
<li><a href="#" rel="prettyPhoto[pp_gal]"><img src="images/thumb.jpg" alt=""/></a>
</ul>
</div><!-- /.galObra -->
<div class="descObra">
<h3>Titulo de la obra</h3>
<p>The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.</p>
</div><!-- /.descObra -->
</div><!-- /#VerObra1 -->
我想,當你在一個縮略圖(.thumbs李一)點擊模式窗口,它改變了上述圖像(#imgAmpliada IMG )。我試過這個代碼,但沒有:
$(function() {
$(".thumbs li a").click(function() {
var image = $(this).attr("rel");
$('#imgAmpliada').hide();
$('#imgAmpliada').fadeIn('slow');
$('#imgAmpliada').html('<img src="' + image + '"/>');
return false;
});
});
$("a[rel^='prettyPhoto']").prettyPhoto({show_title: false, default_width: 800});
請,可能有人解釋我爲什麼不工作?謝謝!
到底究竟是什麼?代碼沒有運行嗎? – 2010-11-23 16:10:16