Load custom window with open.window function?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Inny
    New Member
    • Nov 2007
    • 77

    Load custom window with open.window function?

    Im using the following script to resize and Automate thumbnails of user posted images on my forum. However I dont like the white background of the new window. Im wondering if its possible to launch the full size image in a customized window with a background image, such as

    [HTML]Image veiwer window[/HTML]

    Code:
    <script>
    function ResizeThem() {
    maxheight=250;
    maxwidth= 250;
    imgs=document.getElementsByTagName("img");
    for (p=0; p<imgs.length; p++) {
    if (imgs[p].getAttribute("alt")=="user posted image") {
    w=parseInt(imgs[p].width);
    h=parseInt(imgs[p].height);
    if (parseInt(imgs[p].width)>maxwidth) {
    imgs[p].style.cursor="pointer";
    imgs[p].setAttribute('alt','Reduced Image - Click to see full size');
    imgs[p].onclick=new Function("iw=window.open(this.src,'ImageViewer','resizable=1,scrollbars=1');iw.focus()");
    imgs[p].height=(maxwidth/imgs[p].width)*imgs[p].height;
    imgs[p].width=maxwidth;
    }
    if (parseInt(imgs[p].height)>maxheight) {
    imgs[p].style.cursor="pointer";
    imgs[p].onclick=new
    Function("iw=window.open(this.src,'ImageViewer','resizable=1,scrollbars=1');iw.focus()");
    imgs[p].width=(maxheight/imgs[p].height)*imgs[p].width;
    imgs[p].height=maxheight;
    }
    }
    }
    }
    ResizeThem();
    </script>
    so far I cannot find a way to make it possible. Any ideas?
  • Inny
    New Member
    • Nov 2007
    • 77

    #2
    Anyone? I was suggested..

    two HTML pages.
    One(A), which you have the thumbnails and another(B), which should pop up when you click on the thumbnail.
    In page (A), create a hidden field with ID "imgurl".
    And when the user clicks on a thumbnail image, store the image's URL in there before opening (B).
    In page (B), create an image object and then set the src property = window.opener.d ocument.getElem entById("imgurl ").value
    I have no idea how to re-write the script to do that!! ??????

    Comment

    • Inny
      New Member
      • Nov 2007
      • 77

      #3
      SOLVED! No longer needed thankyou!

      Comment

      Working...