Use this script:
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox").fancybox({
helpers : {
title : { type : 'inside' }
}, // helpers
afterLoad : function() {
this.title = (this.title ? '' + this.title + '<br />' : '') + 'Image ' + (this.index + 1) + ' of ' + this.group.length;
} // afterLoad
}); // fancybox
}); // ready
</script>
If you set the title attribute on your links with class="fancybox"
, it will display the title on the first line(s) and 'Image x of y
' in the final line. If you didn't specify any title, only 'Image x of y
' will be displayed.
UPDATE: For v2.0.6+ use beforeShow
instead of afterLoad
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…