我正在使用 jquery 漂亮照片插件作为我的图片库。但是当我打开一张照片时,它工作得很好但不显示缩略图,而是显示在其 css 中定义的默认背景:
我的结果:
我想要的结果:
我的 HTML:
<ul class="hover_thumb_wrap">
<li class="hover_thumb_unit">
<a rel="prettyPhoto[18]" class="imgwrap" title="Item Title" href="http://placehold.it/800x600" style="cursor: pointer;">
<img width="50" height="50" alt="Item Thumbnail Alt" class="attachment-50x50" src="http://placehold.it/50x50">
</a>
</li>
<li class="hover_thumb_unit">
<a rel="prettyPhoto[18]" class="imgwrap" title="Item Title" href="http://placehold.it/400x500" style="cursor: pointer;">
<img width="50" height="50" alt="Item Thumbnail Alt" class="attachment-50x50" src="http://placehold.it/50x50">
</a>
</li>
</ul>
我的Javascript:
jQuery("#item-wrap a[rel^='prettyPhoto']").prettyPhoto({
animationSpeed: 'normal', /* fast/slow/normal */
padding: 15, /* padding for each side of the picture */
opacity: 0.7, /* Value betwee 0 and 1 */
showTitle: false, /* true/false */
allowresize: true, /* true/false */
counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
//theme: 'dark_square', /* light_rounded / dark_rounded / light_square / dark_square */
hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
modal: false, /* If set to true, only the close button will close the window */
callback: function() {
var url = location.href;
var hashtag = (url.indexOf('#!prettyPhoto')) ? true : false;
if (hashtag) location.hash = "!";
} /* Called when prettyPhoto is closed */,
social_tools : ''
});