Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

monitor size, screen resolution, and the good ole browser

Status
Not open for further replies.

sqoti

Programmer
Dec 1, 2000
50
US
Does anybody know if there is useful script that will detect the user's monitor size and the resolution setting and can be used to make popup windows behave exactly the way the want.

I know this is asking alot, but I kinda want a smart intelligent web site that will do this. Basically I have popup windows and I want to center them and adjust the size dynamically according to the contents in the window and have this happen no matter what the user has as far as a monitor and resolution setting. They could have a 14in and have 800 x 600 setting, or they could have a 21in with 1024 x 768 setting. I can almost get some code to work the way I want but on 19in monitors set at 800 x 600 it just behaves different.

My big questions is there some cure for this or is this a problem for all Web developers?
 
would this work for you?

var Win
function _open(url,h,w) {
var winl = (screen.availWidth - w) / 2;
var wint = (screen.availHeight - h) / 2;
winprops = 'screenX='+winl+',screenY='+wint+',top='+wint+',left='+winl+',height='+h+',width='+w+',scrollbars=0,resizable=yes';
if(Win && !Win.closed) {
//open in the same if it is still opened
Win.moveTo(winl,wint)
Win.resizeTo(w,h)
Win.location.href=url
// Win.close()
} else
Win = window.open(url,'0', winprops);
}

there a lot of similar scripts here in this forum Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top