I am using jquery prettyphoto in my project. for a image gallery when i click an image, it takes long time to load the prettyphoto, because it loads all image of the gallery to show thumbnails on it. I want to show the thumbnails but don't like taking long time. I have a thumbnail folder for the gallery which are small size files. If I were able to load those thumbnails in the prettyphoto it w开发者_StackOverflow社区ould take less time. I tried but could not find where to change that thumbnail directory manually. Can anyone help me?
Based on the source code for the demos, it looks like you need to specify the thumbnail image in the markup:
<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>
The link points to the full version, but the <img>
src
attribute points to the thumbnail.
The reason why it’s loading all the images is because of the overlay_gallery. You can try to disable it and it should speed things up, it’s a setting you can customize. view sourceprint?
<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>
精彩评论