new fixed window according to image?

hi.<br />
<br />
is it possible to make a link open a new window fixed to the size of an image rather than making a whole new html for that image?<br />
<br />
i want something like <a href=http://www.webdeveloper.com/forum/archive/index.php/"image.jpg">text</a> i know if i put target="_blank" it will open a whole new window, but i don't want the image to open with a lot of blank space. i just want the link to open the window fixed to the image size. <br />
<br />
is this possible? please help me. thanks.<!--content-->what you can possibly do is,<br />
1. create image object,<br />
<br />
then in windows properties<br />
<br />
width="+img.width and same with height.<br />
<br />
that should do it.<!--content-->Thanks Dave. That's EXACTLY what I want. But why isn't it working on my site? I've been trying to alter it and it's getting me so frustrated because it's not working. :mad:<br />
<br />
Here's what I've put on my HTML:<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.geocities.com/tokyo/island/8876/polar/polaroids2.jpg"<br />
target="_blank"<br />
onclick="window.open('image_viewer.html?'+escape('http://www.geocities.com/tokyo/island/8876/polar/polaroids2.jpg'),null,'scrollbars=no,resizable=yes',1);return false;"><img src=http://www.webdeveloper.com/forum/archive/index.php/"http://www.geocities.com/tokyo/island/8876/polar/polaroids2.jpg" alt="click"></a><br />
<br />
It's practically identical to yours but when I click on it, the page with the image can't be found. Any ideas on what's wrong?<!--content-->No.... :p Ok, now i made image_viewer.html, do I have to put anything in that HTML file?<!--content-->Yes, you need to add something like the following to your image_viewer.html page:<br />
<br />
<html><br />
<head><br />
<title>Image Viewer</title><br />
<br />
<script language="javascript" type="text/javascript"><br />
function resizePage() {<br />
if (!window.innerWidth) {<br />
window.resizeTo(document.images[0].width+12,document.images[0].height+38);<br />
}<br />
else {<br />
window.innerWidth = document.images[0].width;<br />
window.innerHeight = document.images[0].height;<br />
}<br />
}<br />
</script><br />
</head><br />
<br />
<body style="margin:0px;" onload="resizePage();"><br />
<script language="javascript" type="text/javascript"><br />
<br />
pic = unescape(window.location.search.substr(1));<br />
document.write ('<img name="myimg" src=http://www.webdeveloper.com/forum/archive/index.php/"'+pic+'" border=0>');<br />
<br />
</script><br />
</body><br />
</html><!--content-->*YAY!* Thank you thank you all! :D<!--content-->
 
Back
Top