SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    Your daddy. WALoeIII's Avatar
    Join Date
    Apr 2001
    Location
    USA
    Posts
    526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Popup in center of screen

    What do I need to add to my code so my popup shows up in the middle of the screen?

  2. #2
    I have an opinion...
    Join Date
    Sep 2001
    Location
    Barrie, Ontario
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <script type="text/javascript">
    
    	var intWidth = 300;
    	var intHeight = 300;
    	var intLeft = (screen.availWidth / 2) - (intWidth / 2 );
    	var intTop = (screen.availHeight / 2) - (intHeight / 2 );
    	var strAttrib = 'width=' + intWidth + ',height=' + intHeight + ',top=' + intTop + ',left=' + intLeft;
    	var objWin = window.open ('http://www.yahoo.com', 'MyWindow', strAttrib);
    
    </script>
    You can see a demo at InteliDev - PopUp Demo.
    Egotist: A person more interested in himself than in me.
    KodeKrash - Eidix - Barrie LUG


Bookmarks

Posting Permissions

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