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!

Open New Window

Status
Not open for further replies.

debbie1212

Programmer
May 31, 2000
66
US
I have a page that contains an image that was originally a lot larger than the screen so I reduced the size. I want the user to be able to click the image to view it full size in a new window. However none of the code I've found works the way I need it to. Since the new image is larger than the screen they will need to scroll it which is fine. Unfortunately the image is getting reduced to fit within the screen but I don't want it to.

This is one of the lines of code I used:

<a href=&quot;mthend1b.gif&quot; onclick=&quot;window.open('mthend1b.gif','New','width=700,height=500','scrollbars=yes')&quot; width=946 height=1267><img border=&quot;0&quot; src=&quot;mthend1a.gif&quot;></a>

Thanks,
Debbie
 
u change your code like this, perhaps it could help
i snip some of it....
Code:
onclick=&quot;window.open('mthend1b.gif','New','width=700,height=500,scrollbars=yes')&quot;

window.open (URL, window new name, window properties)
it only contains 3 parameters.


hope it helps

*JJ26* [spin]
 
Try this one...


Code:
<script language=&quot;JavaScript&quot;><!--
function openWin(img) {
  winId = window.open('','newwin','width=300,height=400');
  winId.document.write('<body onLoad=&quot;if (window.focus) window.focus()&quot;><center>');
  winId.document.write('<img src=&quot;' + img + '&quot;>');
  winId.document.write('</center></body>');
  winId.document.close();
}
//--></script>

<a href=&quot;javascript:;&quot; onClick=&quot;openWin('image1.gif'); return false&quot;>image1</a>

*JJ26* [smile]
 
I may not understand your problem but it seems to me that this will work.. simple code to.

<a target=&quot;newWindow&quot; href=&quot;big_image.gif&quot;><img src=&quot;small_image.gif&quot; width=&quot;100&quot; height=&quot;200&quot; alt=&quot;&quot;></a>

Chap45
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top