Código HTML:
<script language="javascript"> $(document).ready(function() { $("a[rel=listaimagenes]").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none', 'titlePosition' : 'over', 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '</span>'; } }); }); </script> <a rel="listaimagenes" href="image1.jpg ?" style="cursor:pointer"> <img alt="" src="image1.jpg " /> </a> <a rel="listaimagenes" href="image2.jpg ?" style="cursor:pointer"> <img alt="" src="image2.jpg " /> </a> <a rel="listaimagenes" href="image3.jpg ?" style="cursor:pointer"> <img alt="" src="image3.jpg " /> </a>