Results 1 to 5 of 5

Thread: Open Image in seperate window

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    87
    I want to have a thumbnail view of images, and then when they click on the image it opens a seperate window with the larger image in it. From examples I have seen with javascript, it can open an html page fine, but not the image directly. Can anyone help?

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Hi,
    I dont think you can open an image directly(without any html) on a browser. That will only work if they users have selcted Internet Explorer as their defualt viewer for those image types.

    You can put the larger version of the image in a html file and load that when users click on the thumbnail.

    Hope this helps.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3
    Guest
    Why don't you use HTML to control and images HEIGHT and WIDTH properties for a thumbnail. And you can use JavaScript to open it in new page and view it in that page with the image an original size.

    Just change to fit your needs.

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    function openIMG(){
    windowOpen=window.open("",'Open','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=1,width=420,height=420');
    windowOpen.document.writeln("<head><title>Image</title></head><body>");
    windowOpen.document.writeln('<img src=http://www.mysite.com/mygif.gif border=1>');
    windowOpen.document.writeln("</body></html>");
    }
    </SCRIPT>
    And in the image:

    Code:
    <a href="javascript:openIMG();">
    You can always assign openIMG(MyIMG) like so you can use it over and over again.
    You basically get the idea, I hope.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    87
    Thanks Matthew, thats just what I was after :-)

  5. #5
    New Member
    Join Date
    Jul 2008
    Posts
    1

    Re: Open Image in seperate window

    Help!

    I have finally figured out how to enter the script above (THANKYOU) and have got my thumbnails to open a larger image in a new window. BUT..... I have several thumbnails, (for which I have used the same script) - and they are all showing the image (in the new window) of the last thumbnail.

    Are you able to explain what is meant by "openIMG(MyIMG)" in simple terms!???
    This is frustrating!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width