我想使用 jQuery Thickbox 来显示我的图像,但到目前为止,当我点击缩略图时,我得到的只是加载进度条。我已经将我的显示设置如下(也许这会有所帮助)
<div class="thumbs">
{% for p in photos %}
<a href="{{ p.original_image.url }}" title="{{ p.position.position }}" class="thickbox" rel="gallery-vehicle">
<img src="{{ p.thumbnail_image.url }}" alt="{{ p.position.position }}" />
</a>
{% endfor %}
</div>
上述代码的输出是:
<div class="thumbs">
<a href="/site_media/photos/16766966.jpg" title="Front" class="thickbox" rel="gallery-vehicle">
<img src="/site_media/photos/photos/16766966_thumbnail_image.jpg" alt="Front" />
</a>
<a href="/site_media/photos/iPPJ3216_1.jpg" title="Side View" class="thickbox" rel="gallery-vehicle">
<img src="/site_media/photos/photos/iPPJ3216_1_thumbnail_image.jpg" alt="Side View" />
</a>
<a href="/site_media/photos/2010-acura-mdx-15.jpg" title="Interior" class="thickbox" rel="gallery-vehicle">
<img src="/site_media/photos/photos/2010-acura-mdx-15_thumbnail_image.jpg" alt="Interior" />
</a>
<a href="/site_media/photos/acura04.jpg" title="Dashboard" class="thickbox" rel="gallery-vehicle">
<img src="/site_media/photos/photos/acura04_thumbnail_image.jpg" alt="Dashboard" />
</a>
</div>
对于 js 和样式表,我将它们连接起来如下:
<script type="text/javascript" src="/site_media/js/jquery.js"></script>
<script type="text/javascript" src="/site_media/js/thickbox.js"></script>
<link rel="stylesheet" type="text/css" href="/site_media/css/thickbox.css" media="screen" />