Announcement

Collapse
No announcement yet.

attached images in pop-up window ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • attached images in pop-up window ?

    I generally use a piece of javascript to open image hyperlinks in a new window, re-sized to fit the dimensions of the image.
    Is it possible to apply the javascript to the attached thumbnails found in the showthread.php page ?

    I put the javascript is in an exterior file - its shown below:

    function PopIma(img) {
    titre="The123d Interview with Julien Vanhoenacker";
    w=open("",'image','width=500,height=500,toolbar=no,scrollbars=yes,resizable=yes');
    w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
    w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
    w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
    w.document.write("");
    w.document.write("</BODY></HTML>");
    w.document.close();
    }


    Then in the header of the HTML pages I put the script's URL <SCRIPT LANGUAGE="JavaScript" src="image_pop.txt"></SCRIPT>

    Finally for the hyperlink I use:

    <a href="javascript:PopIma('image_thumb.jpg')"><img class="imgover" src="image.jpg"></a>


    Is it possible to re-use this for image attachments or does anyone know of another method ?

    many thanks

  • #2
    See this thread.

    Comment


    • #3
      thanks Jake

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X