PDA

View Full Version : pop up images - positioning


kakshmire
05-19-2004, 08:24 PM
so i have a pop up image. and when the new window opens with the image in the image isnt positioned right in the top left hand corner. there is a white space between the corner and the image. its not part of the image and i thought this would have made it top left:

if (type == "console") tools = "resizable=no,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";

and the type on the link is definatley console. i tried using negative values on the left= but nothing changed. i also tried putting left="0" etc. (i don't knwo much about javascript) but that turned the pop up window into a regular window with an address bar and stuff. thanks for any help.

canadianjameson
05-19-2004, 09:14 PM
can you upload it somewhere so we can see it?

kakshmire
05-19-2004, 09:19 PM
http://www.geocities.com/takeshiscastlestuff/java.htm

Willy Duitt
05-19-2004, 11:33 PM
Try replacing this line: newWindow = window.open(url, 'newWin', tools);

With this:
newWindow = window.open('', 'newWin', tools);
with(newWindow.document){
write('<html><body><div style="position:absolute; top:0;left:0">');
write('<img src="'+url+'"></div></body></html>');
close();
}

glenngv
05-20-2004, 04:08 AM
Or just set the body margin to 0

newWindow = window.open('', 'newWin', tools);
with (newWindow.document){
write('<html><head><style type="text/css">body{margin:0px;}</style></head><body>');
write('<img src="'+url+'" /></body></html>');
close();
}

kakshmire
05-20-2004, 05:31 PM
genius. thanks a lot. worked first time. one other thing youve probably been asked a loot, but is there any way tyo chang ethe title of the pop up window?

kakshmire
05-20-2004, 05:45 PM
no matter, i fixed it. im so super clever.