• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Window to front

I'm using the following code to show a 'pop-up' window of images.

function linkimage (number) {
      foo = "image" + number + ".html";

My questions are:

1. is there an option I can add to bring the window to the front?

2. can I calculate the current screen size, so as to center the pop-up?

Thanks in advance.

1 Solution
1. add to your code ...

2. screen.availWidth and height is what u need..
note : put them before u call your window.open
var winX = (screen.availWidth - w)*.5;
var winY = (screen.availHeight - h)*.5;

replace your top and left in window.open with the following :

left=' + winX + '
top=' + winY'
antony061897Author Commented:
Cheers mate. worked a treat.

Do you know of a place which lists all the available javascript verbs, constants etc.?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now