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
  1. #1
    New to the CF scene
    Join Date
    Jul 2003
    Location
    Concord, NC
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    center pop-up problem on 800x600 monitor res

    Hi,

    New here and trying to get some quick help or maybe just a quick reason why my center script is doing what it's doing.

    The problem is really that the script actually works but I need to know if I can fix what it does.

    My window size is 700x700 pixels. The problem is that the script centers the window and 10 pixels at the top and 10 pixels at the bottom of my page are cut off when viewing in 800x600 monitor resolution. I have a scroolbar scripted in but still..the top of the page is cut off. Can I adjust the script to where it just centers the page vertically and just comes in at the top of the page horizontally, not centered? Would much rather do that than not use the center script and way before considering to adjust my page size (I'm lazy and don't want to re do it)

    Any help would be greatly appreciated
    Thanks

    JLo


    the script as it appears:

    <SCRIPT>
    function popUp(page,PWidth,PHeight,id) {
    eval("designerwiz"+id+"=window.open('"+page+"','designerwiz0','toolbar=0,scrollbars=1,location=0,sta tus=1,menubars=0,resizable=0,width="+PWidth+",height="+PHeight+"')")
    eval("designerwiz"+id+".window.moveTo((screen.width/2)-(PWidth/2),(screen.height/2)-(PHeight/2))")
    }
    </SCRIPT>

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Do you want to give this script a try



    <script language="JavaScript" type="text/javascript">
    <!--
    function popWin(url,Width,Height){
    var posX = (screen.availWidth - Width) / 2
    var posY = (screen.availHeight - Height) / 2

    var popUp = window.open(url,'pop','width='+Width+',height='+Height+',left='+posX+',top='+posY+',scrollbars=yes,r esizable=yes') // all one line
    popUp.focus()
    }
    // -->
    </script>

    <a href="#null" onClick="popWin('yourpage.htm',400,150)">Example 3</a>
    <a href="#null" onClick="popWin('yourpage.htm',150,400)">Example 4</a>



  •  

    Posting Permissions

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