HCProfessionals Posted January 27, 2013 Share Posted January 27, 2013 <script type="text/javascript"> $(document).ready(function() { $("#photo_id").fancybox().trigger('click'); }); </script> I'm triggering a specific photo in fancybox when the page loads. How can I put the following options inside of the function? boxOptions: { beforeShow: function () { if (this.title) { this.title += '<br /><br />'; this.title += '<img src="../wallpapers/images/facebook.png" border="0" /> <a href="http://www.facebook.com/sharer.php?u=' + this.href + '" target="_blank">Share on Facebook</a>'; this.title += ' | '; this.title += '<a href="http://pinterest.com/pin/create/button/?url=' + this.href + '" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>'; this.title += ' | '; this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=' + this.href + '&layout=button_count&show_faces=false&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px;" allowTransparency="true"></iframe>'; } }, helpers : { title : { type: 'inside' }, } } Link to comment https://forums.phpfreaks.com/topic/273703-fancybox-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.