does anyone know the best code for "non-automatic" popup windows?
i've done it a few way's, but none seem that great, and the dimensions seem to change depending on what computer/browser i'm on.
it would be great if the pop-window can automatically be centered in the screen too.
thanks!
Good Centered Pop-Ups.
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
You should be able to precalculate the dimensions needed based on screen width and viewport width comparisons.. as for centering, there's a few techniques.
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
This is a script that centers the popup, sized as called, 170px down from the top of the screen.
Code: Select all
function firstWindow(report,winht,winwth)
{
var windowX = (screen.width/2)-(winwth/2);
s = "top=170,left="+windowX+",width="+winwth+",height="+winht;
reportWindow = window.open(report, 'reportWin',s)
reportWindow.focus()
}thanks
thanks for your reply's and help.
i went with this:
http://www.violetnine.com/html/band.html
(click on the band member names)
do you think it functions alright?
the "newsletter" button on the right has the same code as well.
tom.
i went with this:
http://www.violetnine.com/html/band.html
(click on the band member names)
do you think it functions alright?
the "newsletter" button on the right has the same code as well.
tom.