Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with popup.Please!

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You should be using a function
    Code:
    function oPopup(url)
    {
    var newwin = window.open(url,"","width=100,height=60,resizable=0");
    return false;
    }
    Usage:
    Code:
    <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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Apr 2006
    Posts
    117
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •