Share this page 

Open a window with the right dimension for an imageTag(s): Varia


<script language='javascript'>
function display(myimage) {
 html = "<HTML><HEAD><TITLE>Photo</TITLE>" +
  "</HEAD><BODY LEFTMARGIN=0 " 
  + "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>" 
  + "<IMG SRC='" + myimage + "' BORDER=0 NAME=image " 
  + "onload='window.resizeTo(document.image.width,document.image.height)'>"
  + "</CENTER>" 
  + "</BODY></HTML>";
 popup=
 window.open
  ('','image',
  'toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
 popup.document.open();
 popup.document.write(html);
 popup.document.focus();
 popup.document.close()
 };
</SCRIPT>

Use it this way :

<a href="javascript:display('../images/jsht.gif')">Javascript HowTo 1</a>
<a href="javascript:display('../images/jsht2.gif')">Javascript HowTo 2</a>

Try it here : Javascript HowTo 1
Javascript HowTo 2