View Full Version : non maximizeable pop-up
Dr. Web
06-15-2001, 12:45 PM
window.open("help.htm","dep","width=400,height=400,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,scr eenX=100,left=100,screenY=30,top=60");
}
thats my pop-up script.... but I dont want the user to be able to maximize by clicking the 'maximize/ minimize' button in the upper right corner of the pop-up.
Any Ideas? I believe I have done it before, but cant remember how.....and my script library at work is a mere shadow of my home 'collection' ! ha!
dmm1285
06-17-2001, 11:34 PM
I dont know if this will help you, but itll give you a full size pop up that has no menu bar or anything. Ill see if I have a popup thats no max size and no minimize thing.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}
// End -->
</script>
</HEAD>
<BODY BGCOLOR=FFFFFF TEXT=000000 LINK=0000FF VLINK=800080>
<a href="" onClick="fullScreen('mylink.html');">my link</a>
</BODY>
</HTML>
dmm1285
06-17-2001, 11:40 PM
here is what you want I beleive (disregard first post)Its documented and everything!
<HTML>
<HEAD>
<TITLE></TITLE>
<META name="description" content="">
<META name="keywords" content="">
<script>
// set the popup window width and height
var windowW=300 // wide
var windowH=350 // high
// set the screen position where the popup should appear
//var windowX = 260 // from left
//var windowY = 100 // from top
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);
// set the url of the page to show in the popup
var urlPop = "me.html"
// set the title of the page
var title = "me"
// set this to true if the popup should close
// upon leaving the launching page; else, false
var autoclose = true
// ============================
// do not edit below this line
// ============================
s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false
function openFrameless(){
if (beIE){
NFW = window.open("","popFrameless","fullscreen,"+s)
NFW.blur()
window.focus()
NFW.resizeTo(windowW,windowH)
NFW.moveTo(windowX,windowY)
var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
NFW.document.open();
NFW.document.write(frameString)
NFW.document.close()
} else {
NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
NFW.blur()
window.focus()
NFW.resizeTo(windowW,windowH)
NFW.moveTo(windowX,windowY)
}
NFW.focus()
if (autoclose){
window.onunload = function(){NFW.close()}
}
}
</script>
</HEAD>
<BODY BGCOLOR=FFFFFF TEXT=000000 LINK=0000FF VLINK=800080>
<a href="javascript:openFrameless()">me</a>
</BODY>
</HTML>
Dr. Web
06-18-2001, 12:56 AM
hmmmnn, I tried that code, and it didn't do anything.
When I looked at the code, it didn;t seem to declare anything to stop the maximize. Is there a url that shows a non-maximizeable pop up that you viewed?
kevin
06-18-2001, 01:12 AM
I thought the minimum client control was minimize, maximize and close window. Is it really possible to open a window with min/max disabled?
Regards,
Kevin
dmm1285
06-18-2001, 01:46 AM
to see this in action, go to:
http://www.geocities.com/dmm1285/itworksindex.htm
as to why it works, I have no idea, and dont really care. I knew that I had it, and that it has all the comments in makes it easy to moadify. You could work though the functions if you really want to.
amruta
06-18-2001, 01:49 AM
HI
window.open("help.htm","dep"," width=400,height=400,location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0, resizable="no",screenX=100,left=100,screenY=30,top=60");
}
put the attribute resizable="no" . It s shurely working in ie5 and ns6.
Amruta..
Dr. Web
06-18-2001, 06:49 PM
dmm
I can still resize your window by clicking on the maximize button on the grey bar of the browser.
Amruta,
I have used everyvariation of resize=no, 0, and all. What resize does is prevent theuser from draggin a corner of the window over, to make it larger/ smaller. However, the resize button next to the 'x' in the upper right of the browser window will still resize it.
I am not fighting with the resizeable=no part, I wish to disable the user from using the button to resize.
Alas, as Kevin said.... that may be a mandatory control for the browser.
dmm1285
06-18-2001, 10:24 PM
Originally posted by Dr. Web
[B]dmm
I can still resize your window by clicking on the maximize button on the grey bar of the browser.
Thats odd, becasue I cannot. It shows as a windows application in the bar for me. What browser are you uing?
edit: I tried it in netscape 6, and that allows you to resize, I dont know how to acchieve this effect in netscape, but it does in ie.
Dr. Web
06-22-2001, 12:16 PM
I found out what I was thinking of.
In netscape 4.7, if you create a pop-up with the noresize attribute, netscape will 'grey' out the button on the taskbar, and if you right click the taskbar.... the maximize option is also 'greyed' out, so the user can not maximize.
In IE however, it is still present and in working condition.
dmm1285
06-23-2001, 08:27 PM
if youll post your netscape code, Ill make a script that will work for both browsers
Dr. Web
06-23-2001, 11:43 PM
what netscape code?
I didn't write for any browser in particular, but the code is treated differently in Netscape.
window.open("help.htm","dep"," width=400,height=400,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,scr
eenX=100,left=100,screenY=30,top=60");
}
same code that I always use. In IE you can double click on the title line/ or click on the maximize/minimize button to maximize the pop-up past its defined height and width. The same code will not allow the pop-up to be maximized in netscape 4.7
Try it out. If you know a way to prevent the pop-up window from being maximized in IE... please let me know.
whkoh
06-24-2001, 12:14 AM
Hi again, try this:
<script>
function modelesswin(url,mwidth,mheight){
if (document.all&&window.print) //if ie5
eval('window.showModelessDialog(url,"","help:0;resizable:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
else
eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1,scrollbars=1")')
}
//configure URL and window dimensions (width/height)
modelesswin("http://google.com",600,600)
//To load via link, use something like below:
//<a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>
</script>
Script courtesy of Dynamic Drive
http://www.dynamicdrive.com/dynamicindex8/modelesswin.htm
This works perfectly for me
Non-resizeable or resizeable
<SCRIPT LANGUAGE="JavaScript">
//created by A1 javascripts - http://www.a1javascripts.com/
//plase leave this credit intact if using this script
//<--!
function openmypage()
{
window.open ("http://.html","openmypage","width=150,height=100,location=0,menubar=0,resizable=0,scrollbars=1,status=1,titlebar=1,toolbar=0,scr eenX=100,left=100,screenY=30,top=60");
}
//-->
</SCRIPT>
TEXT LINK
--------------
<!-- --><A HREF="javascript: openmypage()" onMouseOver="window.status='ENTER YOUR STATUS WORDS HERE';return true;" onMouseOut="self.status=''" onclick="window.focus()">ENTER YOUR LINK TEXT HERE</A><!-- -->
IMAGE LINK
------------------------
<A HREF="javascript: openmypage()" onMouseOver="window.status='ENTER YOUR STATUS WORDS HERE';return true;" onMouseOut="self.status=''" onclick="window.focus()"><IMG SRC="/photographs/Senegambia Beach.jpg" Alt="Senegambia Beach" BORDER="0" width="100" height="80"></A>
Courtesy of: http://www.a1javascripts.com
Dr. Web
06-24-2001, 01:39 PM
whkoh, yours seems to be working like I need it (though I am getting an error). I'll have to debug that one.... but thanks!
Lee, and everyone else who didn't quite understand what I was asking for:
Attached is a pic of a pop-up created in the normal JS way. Lee's JS is almost identical to the one I first posted in this thread. It creates the pop-up you see in my screen shot. In the pic, there is a blue area, and a green area.
The blue area is the browser maximize/ minimize button. If pressed it will maximize the pop-up (in IE). The green area is the titlebar, and if double clicked will also maximize the pop-up (in IE).
Thus is not a problem in netscape, as the maximize button is greyed out, and double clicking on the titlebar will do nothing.
Finally, if your using IE and you think your pop-up is non-maximizeable....right click on the titlebar, and choose maximize. If the window changes size, then you see what I was trying to stop.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.