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() });