Gallery legends

Discussion in 'Javascript' started by George Steward, Jul 18, 2003.

  1. 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.
     
    George Steward, Jul 18, 2003
    #1
    1. Advertising

  2. George Steward

    Peter Guest

    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>Image " + 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="javascript:self.close();">Close this window</a>\n";
    strText += "</body>\n";
    strText += "</html>\n";

    var popup = window.open("blank.htm", "popup",
    "left=0,top=0,width=1024,height=730");
    with (popup.document) {
    open();
    write(strText);
    close();
    }
    }
    </script>

    </head>

    <body onLoad="initArray();">

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

    </body>
    </html>
    ___________________________

    "George Steward" <> wrote in message
    news:...
    > 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, Jul 19, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Elliott

    Need Help with Thumbnail Gallery in Panel

    David Elliott, Oct 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    325
    Rick Strahl [MVP]
    Oct 18, 2003
  2. umberto
    Replies:
    0
    Views:
    415
    umberto
    Nov 18, 2003
  3. John

    OT: Picture Gallery

    John, Jan 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    440
  4. Stan Sainte-Rose

    Image Manipulations (how to set legends)

    Stan Sainte-Rose, Oct 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    565
    jongalloway
    Oct 2, 2004
  5. Koos Pol

    GD::Graph - Fitting wide legends?

    Koos Pol, Jul 6, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    291
    Koos Pol
    Jul 6, 2004
Loading...

Share This Page