2011-03-16 72 views
2

我在我的项目中使用jQuery的prettyphoto。对于图片库,当我单击图片时,加载漂亮图片需要很长时间,因为它会加载图库的所有图像以显示缩略图。我想显示缩略图,但不喜欢花很长时间。我有一个缩略图文件夹,它是小型文件的图库。如果我能够在相机中加载这些缩略图,则花费的时间会更少。我尝试过,但无法找到手动更改缩略图目录的位置。谁能帮我?jquery prettyphoto问题

回答

2

基于对演示的源代码,它看起来像你需要在标记指定缩略图:

<ul class="gallery"> 
    <li> 
     <a title="This is the description" rel="prettyPhoto" href="/wp-content/themes/NMFE/images/fullscreen/2.jpg"> 
      <img src="/wp-content/themes/NMFE/images/thumbnails/t_2.jpg" alt="This is the title" width="50" height="50"> 
     </a> 
    </li> 
</ul> 

链接指向的完整版本,但<img>src属性指向缩略图。

2

加载所有图像的原因是因为overlay_gallery。 你可以尝试禁用它,它应该加快速度,这是一个你可以自定义的设置。 查看源代码打印

<script type="text/javascript" charset="utf-8"> 

     $(document).ready(function(){ 

      $("a[rel^='prettyPhoto']").prettyPhoto(

      { 

       overlay_gallery: false /* If set to true, a gallery will overlay the fullscreen image on mouse over */ 

      }); 

}); 

</script>