Click to See Complete Forum and Search --> : make popup float over controled elements
rebel
09-12-2003, 10:52 AM
I'm trying to get a popup to float over window controled elements like Dropdowns boxes
I'm reading up on iframes not sure how it would work has anyone worked with this problem?
I was looking at this line :
if(inside.indexOf(".htm") > inside.length -6)
inside = "<iframe frameborder=0 name=\"thefunction\" width="+(width-20)+" height="+(height-50)+" src=\""+inside+"\" scrolling=\"no\" ></iframe>";
and to be honest I do not know exactly how to use it..
Originally posted by rebel
I'm trying to get a popup to float over window controled elements like Dropdowns boxes.
By "popup" do you mean a DHTML popup or a popup Window?
[J]ona
rebel
09-12-2003, 11:05 AM
Its like a DHTML popup
I did'nt want to put the whole code up
but I believe the part in question is :
function raam(inside, color,width,height, background){
titlecolor = "black";
opacitytitle = 45;
if(!width){
width = 250;
height = 150;}
if(inside.indexOf(".htm") > inside.length -6)
inside = "<iframe frameborder=0 name=\"raampje\" width="+(width-20)+" height="+(height-50)+" src=\""+inside+"\" scrolling=\"no\" ></iframe>";
if(!color)
color = "silver";
var thisspan = eval("maildiv.style")
thisspan.pixelLeft = document.body.scrollLeft + 100;
thisspan.pixelTop = document.body.scrollTop + 100;
thisspan.visibility="visible";
output = "<table cellpadding=0 cellspacing=0 width=" + width + " height=" + height + " border=1 ><tr>";
output += "<td onmousedown='sleepen()' style='cursor:hand' onmouseup='JavaScript:document.onmousemove=\"\" ' bgcolor='"+titlecolor+"' style='filter:alpha(opacity="+opacitytitle+");' width =" + 250 + " height="+ 5 +"></td><td bgcolor='339999'>";
output += "<input type='image' alt=\"Close\" onclick='closeraam()' src='"+closebutton+"'></td></tr>";
output += "<tr><td width=100% colspan=2><table ";
if(background)output += "style='background-image:url(\" " + background + "\")'";
output += " width=100% height=100% bgcolor='"+color+"'><tr><td height=100% width=100% >"+ inside+"</td></tr></table></td></tr>";
maildiv.innerHTML = output;
}function closeraam(){maildiv.style.visibility="hidden";}
When the popup goes over the dropdown box, set the dropdown box's visibility to "hidden." Khalid Ali can elaborate more on this...
[J]ona
rebel
09-12-2003, 11:42 AM
Originally posted by Jona
When the popup goes over the dropdown box, set the dropdown box's visibility to "hidden." Khalid Ali can elaborate more on this...
[J]ona
This logic is put into the XSL???
I don't understand your reply.
[J]ona
rebel
09-12-2003, 04:32 PM
first looking at the actual problem :
I have a popup window that floats under the dropdown fields
(this being that dropdown list boxes are window controled elements)
I wanted to know is that a to keep the window on top
having the dropdown go to hidden when passed seems like a lot of x and y pionter logic to have to move through
I was hoping there is a easier way...
ok
I know this is abad thing to do "sorry all"
but here is the script:
var closebutton = "images/cross2.gif"; //Adress of image of the button
var rgobutton = "images/btn_rgomodel.gif"; //Adress of image of the button
var mymodelbutton = "images/btn_mymodel.gif"; //Adress of image of the button
var raampje, xtra, ytra;
function sleepen(){if (event.button!=1)return;
raampje = eval("maildiv");temp1=raampje.style.posLeft;
temp2=raampje.style.posTop;xpos=event.clientX;
ypos=event.clientY;xtra = temp1-xpos;
ytra = temp2-ypos;document.onmousemove=plaats;}
function plaats(){if (event.button==1){
raampje.style.pixelLeft=event.clientX+xtra;
raampje.style.pixelTop=event.clientY+ytra;return false;}}
function raam(inside, color,width,height, background){
titlecolor = "black";
opacitytitle = 45;
if(!width){
width = 250;
height = 150;}
if(inside.indexOf(".htm") > inside.length -6)
inside = "<iframe frameborder=0 name=\"raampje\" width="+(width-20)+" height="+(height-50)+" src=\""+inside+"\" scrolling=\"no\" ></iframe>";
if(!color)
color = "silver";
var thisspan = eval("maildiv.style")
thisspan.pixelLeft = document.body.scrollLeft + 100;
thisspan.pixelTop = document.body.scrollTop + 100;
thisspan.visibility="visible";
output = "<table cellpadding=0 cellspacing=0 width=" + width + " height=" + height + " border=1 ><tr>";
output += "<td onmousedown='sleepen()' style='cursor:hand' onmouseup='JavaScript:document.onmousemove=\"\" ' bgcolor='"+titlecolor+"' style='filter:alpha(opacity="+opacitytitle+");' width =" + 250 + " height="+ 5 +"></td><td bgcolor='339999'>";
output += "<input type='image' alt=\"Close\" onclick='closeraam()' src='"+closebutton+"'></td></tr>";
output += "<tr><td width=100% colspan=2><table ";
if(background)output += "style='background-image:url(\" " + background + "\")'";
output += " width=100% height=100% bgcolor='"+color+"'><tr><td height=100% width=100% >"+ inside+"</td></tr></table></td></tr>";
maildiv.innerHTML = output;
}function closeraam(){maildiv.style.visibility="hidden";}
function first()
{
outp = "";
outp += "<center><font style='Arial' color='003333' size='3'>blah blah blah";
outp += "<center> blah blah blah?<br/>";
outp += "<input type='image' alt=\"RGO\" onclick='closeraam()' src='"+rgobutton+"'> <input type='image' alt=\"my model\" onclick='closeraam()' src='"+mymodelbutton+"'>";
raam(outp, "ffffff",250,100);
}
</script>
<div ID="maildiv" style="visibility:hidden;position:absolute" align="center"></div>
Originally posted by rebel
first looking at the actual problem :
I have a popup window that floats under the dropdown fields
(this being that dropdown list boxes are window controled elements)
I wanted to know is that a to keep the window on top
having the dropdown go to hidden when passed seems like a lot of x and y pionter logic to have to move through
I was hoping there is a easier way...
The only way that I'm aware of that will work, is to check to see when the window is over the dropdown box, and when it is over it, hide the dropdown box.
[J]ona