Results 1 to 2 of 2

Thread: pop up window with each image swap

  1. #1
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default pop up window with each image swap

    Hello everyone,
    need some assistance with a pop up while making images swap. As I have on my page listed below, if you click on any image it swaps with the larger image, but I can not figure out how to make the image that may be showing to go into a pop up window. my webpage is listed below and the source code below that.


    www.detourgearzone.com/catrbebo1lbp.html


    [CODE]</table>
    <SCRIPT LANGUAGE="JavaScript">
    var aryImages = new Array(2);

    aryImages[0] = "http:/lib/yhst-29728507864769/camelbak-5l-black-lg.jpg";
    aryImages[1] = "http:/lib/yhst-29728507864769/camelbak-5l-pink-lg.jpg";
    aryImages[2] = "http:/lib/yhst-29728507864769/camelbak-5l-grey-lg.jpg";
    aryImages[3] = "http:/lib/yhst-29728507864769/camelbak-5l-red-lg.jpg";
    aryImages[4] = "http:/lib/yhst-29728507864769/camelbak-5l-blue-lg.jpg";
    aryImages[5] = "http:/lib/yhst-29728507864769/camelbak-5l-purple-lg.jpg";

    for (i=0; i < aryImages.length; i++) {
    var preload = new Image();
    preload.src = aryImages[i];
    }
    function swap(imgIndex) {
    document['imgMain'].src = aryImages[imgIndex];
    }
    // End -->
    </script>

    <BODY onLoad="swap(0);">

    <br>
    <br>
    <table>
    [ICODE]


    Any help is greatly appreciated
    Last edited by robertatdetour; 07-23-2009 at 11:17 PM. Reason: forgot items

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Try this script where you can write content directly into a popup without creating a series of new pages to hold each image:
    http://www.quirksmode.org/js/popup.html#writing

    Looking at your page, I'm not sure why you'd want to open up each image in a new popup though - surely the image swap as you have it looks nicer?

    Beverley

Bookmarks

Posting Permissions

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