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 2 of 2

Thread: Window PopUPs

  1. #1
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Window PopUPs

    I have a script that allows me to set the size of each popup windows independently, how can i modify this script so that i can set the position of the window also ? I have pasted the script below:

    <script type="text/javascript">
    function openWindow(url,h,w){
    window.open(url,"","height="+h+",width="+w+",scrollbars,status");
    }
    </script>



    This is in the body

    <a href="http://" onclick="openWindow('products.html','400','300');return false">Open window</a>

  • #2
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this:
    Code:
    function openWindow( url, h, w, x, y )
    {
    	w = window.open(url, "", "height="+h+", width="+w+",scrollbars,status");
    	w.moveTo( x, y );
    }
    Then call it like this:
    Code:
    <a href="#" onclick="openWindow('products.html', '400', '300', '0', '0');">Open window</a>
    Good luck.
    Last edited by fredmv; 10-21-2003 at 07:00 AM.
    Moderator @ WebDeveloper.com
    Mentor @ WebXpertz.net


  •  

    Posting Permissions

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