Forum Home
Press F1
 
Thread ID: 34513 2003-06-15 22:12:00 Javascript problem Greg S (201) Press F1
Post ID Timestamp Content User
152768 2003-06-15 22:12:00 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 (www.floraldesignsbyiris.co.nz). Can anyone see where I've gone wrong?

Thx.
Greg S (201)
152769 2003-06-16 00:26:00 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. Dolby Digital (160)
152770 2003-06-18 00:27:00 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')">
Pams_Note (4021)
152771 2003-06-22 06:17:00 *bump* :D

The couple of responses so far were much appreciated, but didn't present a cure.
Greg S (201)
152772 2003-06-22 08:45:00 Have you thought about making the window bigger??? stu140103 (137)
152773 2003-06-22 09:09:00 > 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
stu140103 (137)
152774 2003-06-22 13:52:00 > Have you thought about making the window bigger???

Yeah thx Stu - tried that. :(
Greg S (201)
152775 2003-06-22 23:38:00 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.
Kame (312)
152776 2003-06-23 01:07:00 > > 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)
stu140103 (137)
1