Thanks to this answer, I have a way of launching a fancybox iframe on page-load: http://www.casedasole.it/fancybox/A.html
This answer shows how to open a fancybox iframe whose content is encoded in javascript in the page that launches the iframe: http://www.casedasole.it/fancybox/B.html
Is there some way of having B do what A does - i.e. launch itself on page-load?
NB: The hidden div approach (see here) won't work because I need to be able to navigate within the iframe once opened.
Just do :
See JSFIDDLE
Notice the
myContent
variable contains the fullhtml
structure, includingDOCTYPE
,<html>
,<head>
an<body>
sections. Although it's not mandatory, it will give you more control over the settings of your initial (iframed) page.Also notice in my jsfiddle I separated the base content (
html
basic structure) from the custom content (the<div>
as in your example) for tidiness purposes ;)Refs :