Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Window to front

Posted on 1999-07-12
2
Medium Priority
?
194 Views
Last Modified: 2010-04-09
I'm using the following code to show a 'pop-up' window of images.

function linkimage (number) {
      foo = "image" + number + ".html";
      bar=window.open(foo,"linkimage","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=250,height=310,top=40,left=40")
}

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.

Antony
0
Comment
Question by:antony061897
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
slok earned 400 total points
ID: 1851848
1. add to your code ...
  bar.focus();

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'
0
 

Author Comment

by:antony061897
ID: 1851849
Cheers mate. worked a treat.

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

Antony
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question