Gallery legends

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • George Steward

    Gallery legends

    I have a WebPages which displays 20 thumbnails and, on clicking the
    thumbnail, that picture is enlarged to a separate box. That all works all
    right but try as I may, I am unable to have the legend/description of the
    picture with the picture.
    Can anybody help please as I have gone to tilt trying for 2 days.
    the solution could be in JavaScript or HTML, I already have the array
    selection bit working but cannot display the result.



  • Peter

    #2
    Re: Gallery legends

    I think this is something along the lines of what you are looking for... You
    can tweak it for your own purposes. The initArray function initialises the
    array containing the location of the images. The script in the body section
    writes out the links. The openImg function gets kicked off after you click
    on any of the links. It then opens up a page containing a header the img and
    a link to close the popup window. You can make this popup page look like
    anything you specify. You will need to have a blank.htm file for the popup
    function to load into the page initially otherwise you will see a page not
    found error before you see the image come up. Just put the following html
    into it "<html></html>" so that it takes the minimum length of time to load.

    Peter.
    _______________ ____________
    <html>
    <head>
    <title></title>
    <script type="text/javascript">
    var vntImg = new Array();

    function initArray() {
    for (var t = 0; t <= 9; t++) {
    vntImg[t] = "/Windat/540/0" + String(t) + ".jpg";
    }
    }

    function openImg(t) {
    var strText = new String();

    strText += "<html>\n";
    strText += "<head>\n";
    strText += "<title>Ima ge " + String(t) + "</title>\n"
    strText += "</head>\n\n";
    strText += "<body>\n";
    strText += "<center>\n ";
    strText += "<h1>Image " + String(t) + "</h1>\n";
    strText += "<img border=\"0\" src=\"" + vntImg[t] + "\"><br>\n\ n"
    strText += "<a href="javascrip t:self.close(); ">Close this window</a>\n";
    strText += "</body>\n";
    strText += "</html>\n";

    var popup = window.open("bl ank.htm", "popup",
    "left=0,top=0,w idth=1024,heigh t=730");
    with (popup.document ) {
    open();
    write(strText);
    close();
    }
    }
    </script>

    </head>

    <body onLoad="initArr ay();">

    <script type="text/javascript">
    for (var t = 1; t <= 9; t++) {
    with (document) {
    write("<a href=\"javascri pt:openImg(" + String(t) + ");\">Pic " +
    String(t) + "</a><br>\n");
    }
    }
    </script>

    </body>
    </html>
    _______________ ____________

    "George Steward" <gostewa@clara. net> wrote in message
    news:1058531431 .16599.0@demete r.uk.clara.net. ..[color=blue]
    > I have a WebPages which displays 20 thumbnails and, on clicking the
    > thumbnail, that picture is enlarged to a separate box. That all works all
    > right but try as I may, I am unable to have the legend/description of the
    > picture with the picture.
    > Can anybody help please as I have gone to tilt trying for 2 days.
    > the solution could be in JavaScript or HTML, I already have the array
    > selection bit working but cannot display the result.
    >
    >
    >[/color]


    Comment

    Working...