To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > ClientSide Technologies

ClientSide Technologies Discuss HTML/CSS/Javascript, and any other client-side technologies, here.

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-03-2006, 03:18 PM   #1
homer09001
Senior Member
 
Join Date: Apr 2005
Posts: 479
custom sized pop up

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
homer09001 is offline   Reply With Quote
Old 06-03-2006, 04:11 PM   #2
rikmoncur
count($dracula)
 
rikmoncur's Avatar
 
Join Date: Apr 2005
Location: Scotland
Posts: 369
<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>
rikmoncur is offline   Reply With Quote
Old 06-04-2006, 06:30 AM   #3
MarkR
Senior Member
 
Join Date: Jul 2004
Location: Oxford, England
Posts: 1,983
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
MarkR is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 10:33 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.