How to open jQuery Fancybox automatically with content from div element
It can be simply done by using advanced option content for jQuery Fancybox.
Any HTML data can be passed to the option content.
The following code uses function html in jQuery to get HTML content of div element with id "lightbox-content" and passes it to the option content.
jQuery.fancybox({ content: jQuery( '#lightbox-content' ).html() });
Continue reading here: Responsive Image Lightbox with 3D Animation Effects using CSS3 Transitions without Java Script
Was this article helpful?