Click to See Complete Forum and Search --> : How to create IFRAME in javascript?


ZhiYi
February 27th, 2006, 01:09 AM
Does anybody know how to create an IFRAME so that a DIV can be placed on top of the IFRAME and SELECT?

The purpose is to allow a pop up menu not to be blocked by a windowed control e.g listbox.

I think DIV represents a windowless control like the popup menu while SELECT represents a windowed control like the listbox.

Below is a javascript file code snippet: (ContextMenu.js)

<script language="Javascript">

function __showContextMenu(menu)
{
var menuOffset = 55
menu.style.left = window.event.x + menuOffset;
menu.style.top = window.event.y -7;
menu.style.display = "";
window.event.cancelBubble = true;

return false;
}

function __trapESC(menu)
{
var key = window.event.keyCode;
if (key == 27)
{
menu.style.display = 'none';

}
}

</script>

There is no html because the menu is a custom control developed using C#. I have come across some IFRAME codes but they seem to be in html. How do I add IFRAME codes into this javascript file?

HanneSThEGreaT
February 27th, 2006, 07:49 AM
This should help you out !

http://www.quirksmode.org/js/iframe.html

Have fun! :wave: