Hi you probably think this is a dumb question but I am trying to get titles added to fancy box 2. I know very little about javascript but have this at the bottom of my html
<script type="text/javascript">
$(document).ready(function() {
$(".fancybox").fancybox();
});
</script>
AND if I try to add in
$(".fancybox")
.attr('rel', 'gallery')
.fancybox({
beforeLoad: function() {
this.title = $(this.element).attr('caption');
}
});
I get all sorts of syntax errors.
Site is: http://bit.ly/Wan5kr
Your current script is :
… but should be (if you don’t want to have “page 1 of 6”) :
On the other hand, if you prefer to use a
captionattribute (because thetitleshows up as tooltip when you hover the images) the changetitlebycaptionlikeand use this script