Forum Moderators: open

Message Too Old, No Replies

Pop-up window pixel dimensions

Problem re: defining consistent pixel dimensions in Mac/PC

         

MattC

12:01 pm on Feb 12, 2002 (gmt 0)

10+ Year Member



I'm not experienced with javascript, I've made a website which is entirely in a small pop-up window. It was constructed using dreamweaver and has two frames inside it.

The problem is that a PC seems to interpret the pixel dimensions correctly but a Mac makes the popup a little to big, that or it's adding a border around the HTML page. This means that the pages don't line up correctly and some content seems to fall of the page as I have turned off the scroll bars.

Is this a common problem which can be easily fixed

knighty

2:21 pm on Feb 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Matt, Welcome to WebmasterWorld!

I would imagine that is is not the size of the pop-up which is causing you the problem. More likely its the code you're using, for a start I would drop the use of frames and make sure that tables, margins etc are all the same - try and avoid using cell padding and spacing as these can be treated differently across browsers.

I design all my pages on a mac and often use pop-ups for help pages etc. Generally I don't have too much of a problem as long as you try to boil everything down. The less complicated the page the less things can go wrong ;)

MattC

2:33 pm on Feb 12, 2002 (gmt 0)

10+ Year Member



Hi knighty,

Thanks for the quick reply. The site unfortunately uses three frames stacked vertically, but as far as I know there is no cell padding or margin.

The site is nearly done, and although it's not a massive job, I can't think of anyway of avoiding frames. I know I can redirect users after checking IE vs NN browsers, is it possible to do a similar thing between Mac + PC where users get redirected to a page where the framesets are 'tweaked' so the pages fit snug?

The site is <in profile>

Hope to hear from you (or anyone else) soon.

(edited by: Xoc at 5:05 pm (utc) on Feb. 12, 2002)

JerryH

3:19 pm on Feb 12, 2002 (gmt 0)



Are you using the same browser on both computers? I know that different browser versions show different results. I use pop-ups on my site as well, and have a solution to determine the users browser and to resize the window accordingly.

I use object detection to determine the browser being used (I only test Netscape and IE). Below are variables to be used in the width and heigth attributes in the window.open command:

//vars preset to work with IE5+, IE6 & NN4
var wide=200
var high=100

//change vars to work with IE4+
if (document.all) {
var wide=wide+12
var high=high+31
}

//change vars to work with IE4+
if (document.all) {
var wide=wide+12
var high=high+31
}

//change vars to work with NN6
if (document.getElementById&&!document.all) {
var wide=wide+8
var high=high+38
}

The above variables work if the window is set to:
resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no

They may have to be tweeked if your window is set differently, but you get the general idea - you just add pixals to your base vars depending upon the browser.

I would suggest that you enable your scrollbar unless your text is in graphic format. If the user has changed his default text size to something larger, it may run off the bottom of your window.

* NOTE: I have just discovered that my pop-up window does not display correctly on an IMac running IE4.5. So I guess I have a little more work to do.

JerryH

3:35 pm on Feb 12, 2002 (gmt 0)



Although I have not tried this yet, you can probably parse the OS information from the navigator.userAgent variable.

See:
[xs4all.nl...]

JerryH

11:02 pm on Feb 12, 2002 (gmt 0)



OK, I fixed the problem I was having with my pop-up window.

I've changed my code above to check to see if IE is running on Windows.

//change vars to work with IE4+
if (document.all && navigator.userAgent.toLowerCase().indexOf('win')>=0) {
var wide=wide+12
var high=high+31
}

Hope this helps.