homer09001
06-03-2006, 03:18 PM
ok im writing a pm system in php but how do i use simple HTML to create a pop up window with the maximum size of the content? and make it non-resizable with no tool bars or anything
|
Click to See Complete Forum and Search --> : custom sized pop up homer09001 06-03-2006, 03:18 PM ok im writing a pm system in php but how do i use simple HTML to create a pop up window with the maximum size of the content? and make it non-resizable with no tool bars or anything rikmoncur 06-03-2006, 04:11 PM <script language="javascript" type="text/javascript"> <!-- start new window here var win= null; function NewWindow(mypage,myname,w,h,scroll){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no'+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no' win=window.open(mypage,myname,settings) if(parseInt(navigator.appVersion) >= 4){win.window.focus();} } // end script here --> </script> <a href="javascript:NewWindow('YOURPAGE.html','','460','365','no')" onfocus="this.blur()" onmouseover="status=''; return true";>LINK</a> MarkR 06-04-2006, 06:30 AM It's going to be difficult to calculate the size of the content before you show the popup window. You could try to put the content into a hidden element (the same width) in the original page, and then measure the size of that, but that is somewhat awkward and error-prone. Not allowing resizing is very rude and some browsers override this anyway. Resizing the window after it pops up is more reasonable, but some browsers block it (because historically some web pages abuse this). You can get the width / heigh of an element using Javascript DOM methods which are documented. Not having scrollbars is also very rude and it means that if you don't correctly calculate the size, some of the content will be clipped and the user won't be able to see it. Mark PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved. |