PDA

View Full Version : Javascript problem



Greg S
16-06-2003, 10:12 AM
Hi. I've just completed a site for a new customer, with some thumbnails that can be clicked on to show a full size version, which open in a new window sized exactly the same dimensions as the full image. Problem is that the images don't fit the window precisely, being slightly off-centre. An example can be found here (http://www.floraldesignsbyiris.co.nz/bouquets.htm). Can anyone see where I've gone wrong?

Thx.

Dolby Digital
16-06-2003, 12:26 PM
Is it a case of that the image is not in the top left corner. The browser concerned (and of course they may be different) place the image in a slightly different place. You may have to add a few pixels to the image size to effectively center it.

Pams_Note
18-06-2003, 12:27 PM
You can set the exact size of the new window for each image to be the extra pixels wider so that the image will sit in the middle. I put the larger image in a table as I wanted text beside it, but it could just as easily be a one cell table, or use leftmargin="0", topmargin="0" [Netscape doesnt like these much]

<A HREF="javascript:location='thispage.html';window.open('n ewwindow.html','newwindow','HEIGHT=380,WIDTH=550,s crollbars=no,toolbar=no,status=no,menubar=no,locat ion=no,resizable=yes,addressbar=no')">

Greg S
22-06-2003, 06:17 PM
*bump* :D

The couple of responses so far were much appreciated, but didn't present a cure.

stu140103
22-06-2003, 08:45 PM
Have you thought about making the window bigger???

stu140103
22-06-2003, 09:09 PM
> Have you thought about making the window bigger???

try this width=418,height=320 then drop the numbers down till you get it to the right size

Hope this helps

Greg S
23-06-2003, 01:52 AM
> Have you thought about making the window bigger???

Yeah thx Stu - tried that. :(

Kame
23-06-2003, 11:38 AM
You could instead of using Javascript to open up a window just open up an HTML page and have topmargin and leftmargin set to 0 or else with the picture create a white border on the right and bottom side so it's seems like it's suppose to look that way. By Default if you don't specify a margin for the window, you'll have that gap.

I'm not that much into Javascript anymore but I know it's possible to do as a lot of advertisements use that method, could just browse one of those types of sites and view their source for how they do it.

stu140103
23-06-2003, 01:07 PM
> > Have you thought about making the window bigger???
>
> try this width=418,height=320 then drop the numbers
> down till you get it to the right size
>
> Hope this helps

Have you tried the above????, because it works!,I have tried it :)
(I copy that page & changed the width & height & it look good :) (You might need to lower the width & height a bit more, but it works)