Examples of iframe popups with the
overlibmws DHTML Popup Library
 
maintained by Foteos Macrides at Macrides Web Services
Discuss these examples, seek help, and offer suggestions
for iframe support via the
overlibmws Support Group.


Popup with iframe content, caption and Close link
Called by the statement:
    return overlib(OLiframeContent('iframePopupContent.html', 510, 145, 'if1', 1, 'auto'),
 WIDTH,510, TEXTPADDING,0, BORDER,2, STICKY, SCROLL,
 CAPTIONPADDING,4, CAPTION,'Example with iframe content and a '
 +'caption  Popup scrolls with the window.',
 MIDX,0, RELY,90,
 STATUS,'Example with iframe content, a caption and a Close link');"
which uses this simple function for the lead argument in the overlib call:
    function OLiframeContent(src, width, height, name, frameborder, scrolling) {
 return ('<iframe src="'+src+'" width="'+width+'" height="'+height+'"'
  +(name!=null?' name="'+name+'" id="'+name+'"':'')
  +(frameborder!=null?' frameborder="'+frameborder+'"':'')
  +' scrolling="'+(scrolling!=null?scrolling:'auto')+'">'
  +'<div>[iframe not supported]</div></iframe>');
}
Import the distribution's iframecontentmws.js support script to have this function available for use in overlib or overlib2 calls.

NOTE that the iframe document within the parent document's primary popup can invoke secondary popups in the parent, and thus not be bound by the margins of the iframe, either by making a parent.overlib2() function call to use an overlibmws_overtwo.js plug-in module imported by the parent, in which case the positioning in the parent document must be via REF, MIDX, MIDY, RELX, RELY, FIXX and/or FIXY commands, or by importing that plug-in itself and using overlib2() function calls with the FRAME,parent command and parameter, in which case cursor-based positioning of the secondary popups (i.e., with respect to cursor position within the iframe content) also can be used.  A third alternative is for the iframe document to import and use both the core and plug-in modules so that it can invoke its own primary popups which if STICKY can invoke their own secondary popups for links in the primary popup's content, but such primary and secondry popups cannot extend beyond the margins of the iframe.
 
Draggable with iframe content, caption and Close link
Called by the statement:
    return overlib(OLiframeContent('iframePopupContent.html', 510, 145, 'if2', 1, 'auto'),
 WIDTH,510, TEXTPADDING,0, BORDER,2, STICKY, DRAGGABLE, CLOSECLICK,
 CAPTIONPADDING,4, CAPTION,'Example with iframe content and a '
 +'caption&nbsp; Draggable via the caption.',
 MIDX,0, MIDY,0,
 STATUS,'Draggable popup with iframe content, a caption and a Close link');"
Which also uses the above simple function.  Note that the iframe document includes code for resetting the o3_draggable runtime variable if a rapid downward drag via the caption area causes the cursor to "slip" into the iframe content:
    <script type="text/javascript">
<!--
if (!document.layers &&
    parent != self && typeof parent.o3_dragging != 'undefined') {
 document.onmouseup = function(e){parent.o3_dragging = 0;}
}
//-->
</script>
Review more iframe and object examples.  Review an example of iframe content with AJAX content.
 
Embedded iframe (name="eif1" id="eif1"):
   
Embedded via the following markup:
    <iframe
  src=
"embeddedIframeContent.html" width="510" height="215"
  name="eif1" id="eif1" frameborder="1" scrolling="auto">
  <div><br>[iframe not supported]<br><br></div>
</iframe>
 
NOTE that the embedded iframe document can invoke primary popups in the parent, and thus not be bound by the margins of the iframe, either by making a parent.overlib() function call to use an overlibmws.js core module imported by the parent, in which case the positioning in the parent document must be via REF, MIDX, MIDY, RELX, RELY, FIXX and/or FIXY commands, or by importing the core module itself and using overlib() function calls with the FRAME,parent command and parameter, in which case cursor-based positioning of the primary popups (i.e., with respect to cursor position within the embedded iframe) also can be used.  If one uses parent.overlib(), then any secondary popups for links in the primary popup's content should use overlib2() function calls without a frame reference to use an overlibmws_overtwo.js plug-in module imported by the parent.  But if the embedded iframe document instead uses an overlib() function call for its own core module with FRAME,parent, then it should use a frame reference pointing to the embedded iframe from the parent's perspective to invoke secondary popups via its own overlibmws_overtwo.js plug-in module.  For the above example which uses eif1 as a unique name and id for the embedded iframe, the function call with frame reference is self.eif1.overlib2().  Also, if the call for a secondary popup uses a lead argument which is defined in the embedded iframe documents as a string in a script block or imported .js file, then a frame reference from the parent's perspective also is needed for that (e.g., self.eif1.comRef for a string variable defined as comRef).
 
Another alternative if the embedded iframe document imports both the core and plug-in modules is to invoke its primary popups without FRAME,parent which if STICKY can invoke secondary popups for links in the primary popups' content also without any frame references, but such primary and secondry popups cannot extend beyond the margins of the embedded iframe.

Use your browser's View Source option to see the markup for these examples.


These examples use overlibmws and its commands.


Copyright Foteos Macrides
  2002-2010.
  All rights reserved.