I Need expert advice on a open new window script

  • webdummy
  • Born
  • Born
  • User avatar
  • Posts: 4

Post 3+ Months Ago

Hi Guys again,

I'm having major problems with this inserted script which works perfectly except that i cant get the image to automatically "fit" the entire pop up window window area, I'm obviously missing something here.

What i'm trying to accomplish is to instead an image opening up in the browser window it opens up in a small iframe window instead. currently I'm using a pop up window thing but I know that people turn off pop ups so it basically useless for me.

An Image i.e, "p10077.jpg" shows in a pop up window the same size in the new window as it appears on the web page. What do I have to add in to this following script to enable the jpg image to fully resize itself to the boudaries of the pop up window and not remain static. In other words if my image is 200 pix and I want it to pop up in this new window at 600 pix the same size as the pop up window is. :oops:

If some one could point me to an "alternative" simple javascript or even a cgi-bin script that does a similar thing to the following script, i.e, that an image opens up in iframe instead of the browser window , I would gratly appreciate it, thanks.

Heres the code,

<a onclick="var ixni='p10077.jpg'; eval(window.ixCloseImagePopupWindow); setTimeout('var ixNewImg=\''+ixni+'\'; ' + window.ixCreateImagePopupWindow,600);" href="#">

<img id="e1" name="e1" src="p10077.jpg" title="mum and dad" alt="p10077.jpg" align="centre" border="0" onload="window.ixCloseImagePopupWindow='if(!(IE && parseInt(navigator.appVersion)==4 && navigator.userAgent.indexOf(\'Mac\')!=-1)) { if(window.ixImagePopupWindow) { if(!window.ixImagePopupWindow.closed) { window.ixImagePopupWindow.close(); } } }';
var s = ' var ixW=window.open(\'\',\'ixImagePopupWindow\',\'resizable=yes,scrollbars=yes,status=yes,width=600,height=600\');';
s += ' ixW.document.open(\'text/html\');';
s += ' ixW.document.writeln(\'<html><head><title>\'+ixNewImg+\'</title></head>\');';
s += ' ixW.document.writeln(\'<body bgcolor=\\\'\'+window.document.bgcolor+\'\\\' text=\\\'\'+window.document.textColor+\'\\\' link=\\\'\'+window.document.linkcolor+\'\\\' alink=\\\'\'+window.document.alinkcolor+\'\\\' vlink=\\\'\'+window.document.vlinkcolor+\'\\\'>\');';
s += ' ixW.document.writeln(\'<center><br><br><img src=\\\'\'+ixNewImg+\'\\\' border=\\\'0\\\'><br><br><br><br>\');';
s += ' ixW.document.writeln(\'</body></html>\'); window.ixImagePopupWindow=ixW;';
s += ' ixW.document.close();';

Thanks Guys. :)

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 30 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.