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

Opening a new window using DOM

Status
Not open for further replies.

Xcircuit

Programmer
Jul 18, 2000
5
GR
I'm opening a new window with a picture. I use the pic's size, but the page genereted by the code has margins (i think) and there white spaces on top and on the left of the pic. How can i make the picture come up with no white space?<br>Here's the code:<br><br>function my_win()<br>{<br>window.open('archive/Jul-18-Tue-0930.jpg','mywindow','width=648,height=488,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');<br>}<br><br><br>Thanks in advance for ur help & time<br>
 
TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" <br><br>putting these in the body tag of page you open should work. <br>If you are not actually opening a page there is not much you can do as far as I know. The styles for these is margin-whatever (eg margin-top;margin-right;etc)
 
hi,Xcircuit,<br><br>it's hradly possible if you dont have html over the image, but it's also a hell of a work to put each image of your archive into a separate html<br><br>anyway there always is a solution. try this one:<br><br>//in the html that has a thumbnail or whatever is the link.<br><br>&lt;SCRIPT language=&quot;JavaScript&quot;&gt;&lt;!--<br>function showImage(){<br> window.open('img.htm?Jul-18-Tue-0930.jpg','mywindow','width=648,height=488,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no')<br>}<br>//--&gt;&lt;/SCRIPT&gt;<br><br>&lt;A href=&quot;javascript:showImage()&quot;&gt;&lt;IMG src=&quot;yourThumb.jpg&quot; border=0 width=100 height=100&gt;&lt;/A&gt;<br><br><br>//then create a img.htm containing the following:<br><br>&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;STYLE type=&quot;text/css&quot;&gt;&lt;!--<br>.myImg {position:absolute;left:0;top:0;}<br>--&gt;&lt;/STYLE&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br><br>&lt;SCRIPT language=&quot;JavaScript&quot;&gt;&lt;!--<br> var buf=window.location.search; <br> // buf=?Jul-18-Tue-0930.jpg<br> var imgName=buf.substring(1,buf.length); <br> // imgName=Jul-18-Tue-0930.jpg<br> document.write(&quot;&lt;DIV class=myImg&gt;&lt;IMG src='&quot;+imgName+&quot;'&gt;&lt;/DIV&gt;&quot;);<br>//--&gt;&lt;/SCRIPT&gt;<br><br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br><br>img.html can be a container to any image which name was a parameter to path in window.open and you will be able to do to your image anything that the DOM allows. it also allows you to make -return- or -close- buttons in your img.html<br><br>hope it's of any help.<br>stanislavr<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top