...

View Full Version : Need help with popup.Please!



zerolanzer
12-31-2006, 08:44 AM
i am doing a popup tat will be called when the user click on the link

the code is:
<script language="JavaScript">
oPopup = window.open(url,"","width=100px, height=60px, resizable=no");
</script>

url been the variable for the destination. The window did open but it was not in the expected width and height and it is resizable. Is there anything wrong with my code?

Thnx in advance

_Aerospace_Eng_
12-31-2006, 08:51 AM
You should be using a function

function oPopup(url)
{
var newwin = window.open(url,"","width=100,height=60,resizable=0");
return false;
}

Usage:

<a href="http://www.google.com" onclick="return oPopup(this.href)">Google</a>

Some browsers don't allow windows to be resized to less than 100 pixels in height.

Tyrial101
12-31-2006, 09:52 AM
If you want to have a script that will allow you to display the height attribute with a value of 60 in compliant browsers and display one with a height value of 100 for non-compliant browsers, you can use the CSS detection script located on the below linked page, replacing the link tag with the script tag linking to your external CSS :)

http://codingforums.com/showthread.php?t=104012



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum