2011-03-16 71 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>