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


You can see a demo at InteliDev - PopUp Demo.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>
Bookmarks