Click to See Complete Forum and Search --> : Problem :Removing frame from popup
rebel
09-03-2003, 12:27 PM
Hi all,
I'm new to the forum so if I break a rule let me know..
I have a alert popup that I want to remove the MS Frame from
I have tried a few things non of them work ..CAN it be done??
-Rebel
rebel
09-03-2003, 12:29 PM
ok ok ok silly me I forgot my script :
function customAlert(msg) {
var winHeight = 150;
var winWidth = 200;
var xPos = (screen.availWidth/2)-(winWidth/2);
var yPos = (screen.availHeight/2)-(winHeight/2);
modalwin = window.open("", "modalwin", "height="+winHeight+",width="+winWidth+",screenX="+xPos+",screenY="+yPos+",left="+xPos+",top="+yPos);
var content = "<html>\
<head>\
<title>Alert</title>\
</head>\
<body bgcolor='#ffffff' onblur='window.focus()'>\
<center>\
<form>\
<table bgcolor='339999' border='0' cellpadding='0' cellspacing='0' class='solid_black'>\
<tr>\
<td>\
<table width='"+(winWidth-20)+"' height='"+(winHeight-20)+"' border='0' class='solid_black'>\
<tr>\
<td height='5' width='200' valign='top' align='right' bgcolor='#339999' style='filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#003333, EndColorStr=#99cccc);'>\
<img src='images/alert.gif' />\
<img src='images/spacer.gif' height='5' width='110'/>\
<input type='image' src='images/close_a.gif' alt='Close' onclick='window.close()'>\
<img src='images/spacer.gif' height='5' width='5'/>\
</td>\
</tr>\
<tr>\
<td height='"+(winHeight-80)+"' valign='middle' align='center' bgcolor='white'>\
"+msg+"\
</td>\
</tr>\
</table>\
</td>\
</tr>\
</table>\
</center>\
</form>\
</body>\
</html>";
modalwin.document.write(content);
modalwin.document.close();
}
Khalid Ali
09-03-2003, 12:30 PM
1 get reference to the popup window e.g
winRef = window,open("...","..","...");
2. then presuming you only had one iframe in it
var iframeRef = winRef.document.getElementsByTagName("iframe")[0];
noe you can use removeCHild and removeNode for NS and IE
you can get DOM implementation for removeCHild from www.w3c.org and try somewhere at microsoft site for removeNode
rebel
09-03-2003, 12:38 PM
Thanks Khalid Ali,
Talking about fast replies this site is the best..
I will check that out right now..
rebel
09-03-2003, 02:30 PM
I found that info to be very interesting and useable on something else I'm working on..
what I'm really trying to do is remove the standard tool bar frame from around the alert popup I'm trying to create
I will also look back through the forum to see if some else has ever posed the same question
Khalid Ali
09-03-2003, 03:26 PM
Originally posted by rebel
what I'm really trying to do is remove the standard tool bar
that you have set in the code where youopen the new window.
such as
winRef = window.open("","","toolbar=no,location=no")
and so on
rebel
09-05-2003, 11:55 AM
this is what I ended up using and it works now I have another problem the window can't be moved is there aay to get around that???
function customAlert(msg) {
var NewWinHeight=200;
var NewWinWidth=200;
// Place the window
var NewWinPutX=100;
var NewWinPutY=100;
TheNewWin =window.open("TheNewWin",'TheNewpop','fullscreen=yes,toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars= no,resizable=no');
TheNewWin.resizeTo(NewWinHeight,NewWinWidth);
TheNewWin.moveTo(NewWinPutX,NewWinPutY);
var content = "<html>\
<head>\
<title>Alert</title>\
</head>\
<body background-color='transparent' onblur='window.focus()' style='overflow:hidden'>\
<center>\
<form>\
<table bgcolor='339999' border='0' cellpadding='0' cellspacing='0' class='solid_black' align='center'>\
<tr>\
<td>\
<table width='"+(NewWinWidth-20)+"' height='"+(NewWinHeight-20)+"' border='0' class='solid_black'>\
<tr>\
<td height='5' width='200' valign='top' align='right' bgcolor='#339999' style='filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#003333, EndColorStr=#99cccc);'>\
<img src='images/alert.gif' />\
<img src='images/spacer.gif' height='5' width='5'/>\
<img src='images/alerttitle.jpg' />\
<img src='images/spacer.gif' height='5' width='5'/>\
<input type='image' src='images/close_a.gif' alt='Close' onclick='window.close()'/>\
<img src='images/spacer.gif' height='5' width='5'/>\
</td>\
</tr>\
<tr>\
<td height='"+(NewWinHeight-80)+"' valign='middle' align='center' bgcolor='white'>\
"+msg+"\
</td>\
</tr>\
</table>\
</td>\
</tr>\
</table>\
</center>\
</form>\
</body>\
</html>";
TheNewWin.document.write(content);
TheNewWin.document.close();
}</script>