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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new window

Status
Not open for further replies.

kathyc20

Programmer
Mar 7, 2001
96
0
0
CA
I have a number of thumbnail images on my web page that
when the user clicks an image it opens a new window
and displays the graphic at a larger size.

I have put the following in my web page...


<a href=&quot;Javascript:newWindow(10)&quot;>
<img src=&quot;images/pic_10.gif&quot; border=1 width=90 height=60></a>


Inside my Javascript I have the following code...

... switch statement..

case 10:
window.open(&quot;&quot;NewWindow&quot;,&quot;width=372,height=351&quot;);

But when the image appears in the new window it has a top
and left margin that I would like to set to 0.

Can anyone tell me how I can set the margins?

Any help would be appreciated.
 
Hi KathyC20.
Instead of linking to just the image, try linking to an HTML file which forces the image to appear in the middle, like this:
Code:
<table width=100% height=100%><tr align=middle valign=middle><td><center><img src=&quot;whatever&quot; border=0 width=XXX height=ZZZ></center></td></tr></table>
Replace &quot;whatever&quot; &quot;XXX&quot; and &quot;ZZZ&quot; of course. I've used this trick a lot. Hope it helps.
 
Code:
case 10;
var newpage = window.open(&quot;&quot;,&quot;NewWindow&quot;,&quot;width=372,height=351&quot;);
newpage.window.open();
newpage.document.write('<html><body topmargin=0 leftmargin=0 background=[URL unfurl="true"]http://206.47.120.25/bahamas/images/pic_10.gif></body></html>');[/URL]
---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top