justuptime.com - monitor your servers & websites

Perfect Popup

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.
Reece S's picture

He has: 169 posts

Joined: Oct 2007

Hi, Can anyone plz tell me a code that will initiate a popup window with height, and width to match it's content?
thanks in advance.

Smp Business Hosting's picture

They have: 60 posts

Joined: Aug 2007

Hi,

This is a simple javascript popup that resizes the window, however if they have popups and new windows in IE set to open in a new tab instead it won't resize.

Quote: ((put between ))
<script language="JavaScript" type="text/javascript" src="popup.js"></script>

((put in file called popup.js))
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=276,height=239,left = 511,top = 476');");
}

((place this where you want the link - remove the space below before popUp))
TEXT OR IMAGE HERE

Just change the width and height in the popup.js file to what you want and edit all the text in capitals.

If you want to see it in action click on our link, click on hosting and then click on one of the info icons next to the list of resources.

Regards, Steve

Smp Business Hosting – Quality & Affordable web hosting solutions.

Reece S's picture

He has: 169 posts

Joined: Oct 2007

ahh, thank you, i neede this, google dint help me much.
thanks again.