PBall
asked on
Point for ddoyle
Q:FORM elements appearing on top of higher Z-Indexed DIV.
A:
Use Scriptlet
Sample code:
<menupanecont.html>
<html>
<head>
<meta name="generator" value="Microsoft Scriptlet Wizard">
<meta name="content-type" value="text/html; charset=iso-8859-1">
<script language=javascript for=george event=onclick>
alert("george was clicked!");
george.Text = "Hi I\'m George";
</script>
<script language=javascript for=frank event=onclick>
alert("frank was clicked!");
frank.Text = "Hi I\'m Frank";
if (george.style.display=="no ne")
{
george.style.display="bloc k";
}
else
{
george.style.display="none ";
}
</Script>
<Script language=javascript for=frank event=onscriptletevent(eve ntname,eve ntobject)>
myText.innerHTML= "Frank received a: " + eventname;
</Script>
<Script language=javascript>
function init()
{
george.color="#CCCFFF";
frank.color="#00CC00";
}
</Script>
<script language=javascript for=frank event=onmousemove>
george.Text = "X:" + event.x + " Y:" + event.y;
</Script>
</head>
<body bgcolor="#FFFFFF" onload="init()">
<div style='z-index:0'>
<form>
<select name=selblah>
<option>blah blah
<option>blah blah
<option>blah blah
</select>
<input type=button value='click me' onClick='george.style.visi bility=""' >
<input type=button value='click me' onClick='frank.style.visib ility=""'>
</form>
</div>
<object type="text/x-scriptlet" style="position:absolute;t op:0;width :300;heigh t:30;z-ind ex:9999;vi sibility:h idden" id="george">
<param name=url value="MenuPane.html">
</object>
<object type="text/x-scriptlet" style="position:absolute;t op:30;widt h:300;heig ht:30;z-in dex:9999;v isibility: hidden" id="frank">
<param name=url value="MenuPane.html">
</object>
<Span style="position:absolute;t op:100" id=myText></Span>
</body>
</html>
<menupane.html>
<html>
<head>
<title>MenuPane Scriptlet</title>
</head>
<script language=JScript>
var description = new MenuPane;
function MenuPane()
{
this.get_Text = public_get_Text;
this.put_Text = public_put_Text;
this.put_color = public_put_color;
this.get_golor = public_get_color;
}
var Text;
var color;
function public_put_color(newValue)
{
color = newValue;
document.bgColor = color;
}
function public_get_color()
{
//return color;
return document.bgColor;
}
function public_get_Text()
{
return Text;
}
function public_put_Text(newValue)
{
Text = newValue;
headline.innerHTML = Text;
}
function blick()
{
headline.innerHTML = "This is a menu item";
external.bubbleEvent();
}
function bouse()
{
external.bubbleEvent();
}
function sendEvent(evt)
{
external.raiseEvent(evt,do cument);
}
</script>
<body language=JScript onclick=blick() onmousemove=bouse() onmouseover=sendEvent("mou seover") onmouseout=sendEvent("mous eout") bgcolor="#FFFCCC">
<DIV id=bigdiv style="position:absolute;t op:0;width :400;heigh t:50;">
<SPAN style="position:absolute;t op:0;" id=headline></SPAN>
</Div>
</body>
</html>
Although buggy, it does work.
A:
Use Scriptlet
Sample code:
<menupanecont.html>
<html>
<head>
<meta name="generator" value="Microsoft Scriptlet Wizard">
<meta name="content-type" value="text/html; charset=iso-8859-1">
<script language=javascript for=george event=onclick>
alert("george was clicked!");
george.Text = "Hi I\'m George";
</script>
<script language=javascript for=frank event=onclick>
alert("frank was clicked!");
frank.Text = "Hi I\'m Frank";
if (george.style.display=="no
{
george.style.display="bloc
}
else
{
george.style.display="none
}
</Script>
<Script language=javascript for=frank event=onscriptletevent(eve
myText.innerHTML= "Frank received a: " + eventname;
</Script>
<Script language=javascript>
function init()
{
george.color="#CCCFFF";
frank.color="#00CC00";
}
</Script>
<script language=javascript for=frank event=onmousemove>
george.Text = "X:" + event.x + " Y:" + event.y;
</Script>
</head>
<body bgcolor="#FFFFFF" onload="init()">
<div style='z-index:0'>
<form>
<select name=selblah>
<option>blah blah
<option>blah blah
<option>blah blah
</select>
<input type=button value='click me' onClick='george.style.visi
<input type=button value='click me' onClick='frank.style.visib
</form>
</div>
<object type="text/x-scriptlet" style="position:absolute;t
<param name=url value="MenuPane.html">
</object>
<object type="text/x-scriptlet" style="position:absolute;t
<param name=url value="MenuPane.html">
</object>
<Span style="position:absolute;t
</body>
</html>
<menupane.html>
<html>
<head>
<title>MenuPane Scriptlet</title>
</head>
<script language=JScript>
var description = new MenuPane;
function MenuPane()
{
this.get_Text = public_get_Text;
this.put_Text = public_put_Text;
this.put_color = public_put_color;
this.get_golor = public_get_color;
}
var Text;
var color;
function public_put_color(newValue)
{
color = newValue;
document.bgColor = color;
}
function public_get_color()
{
//return color;
return document.bgColor;
}
function public_get_Text()
{
return Text;
}
function public_put_Text(newValue)
{
Text = newValue;
headline.innerHTML = Text;
}
function blick()
{
headline.innerHTML = "This is a menu item";
external.bubbleEvent();
}
function bouse()
{
external.bubbleEvent();
}
function sendEvent(evt)
{
external.raiseEvent(evt,do
}
</script>
<body language=JScript onclick=blick() onmousemove=bouse() onmouseover=sendEvent("mou
<DIV id=bigdiv style="position:absolute;t
<SPAN style="position:absolute;t
</Div>
</body>
</html>
Although buggy, it does work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER