View Full Version : Need help with popup.Please!

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");

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

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;


<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.

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 :)