Is there a global script to open all links on a page in a pop up for a photo album.

Discussion in 'Javascript' started by Erik, Sep 17, 2003.

  1. Erik

    Erik Guest

    Hello,
    I have a page with about 100 links in the form of thumb nails that
    open a small html page. It took a lot of time to define each link and
    I sure do not want to go though that again.

    I would like to know if there is a way to make a global script that
    will open any link (thumb nail) that I push on that page in a pop up.
    Remember each pop up is a small html page and not just a photo.

    I got some few answers in my last post but none of them worked.

    Thank you so much for you time.

    All the best
    Erik

    www.eriksworld.org

    Sweden
     
    Erik, Sep 17, 2003
    #1
    1. Advertising

  2. (Erik) writes:

    > I have a page with about 100 links in the form of thumb nails that
    > open a small html page. It took a lot of time to define each link and
    > I sure do not want to go though that again.
    >
    > I would like to know if there is a way to make a global script that
    > will open any link (thumb nail) that I push on that page in a pop up.
    > Remember each pop up is a small html page and not just a photo.
    >
    > I got some few answers in my last post but none of them worked.


    How did they fail?

    You can add an onclick event handler to all links on the page (or to
    some of them):
    ---
    function click() {
    window.open(this.href,this.target,"width=400,height=300,resizable=yes");
    }

    for (var i=0;i<document.links.length;i++) {
    var link = document.links;
    if ( ... link is a thumbnail link ... ) {
    link.onclick = click;
    }
    }
    ---
    /L
    --
    Lasse Reichstein Nielsen -
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Sep 17, 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. Ben Cartwright

    Photo Album

    Ben Cartwright, Jan 22, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    603
    Ken Cox [Microsoft MVP]
    Jan 23, 2004
  2. Guadala Harry

    Basic Photo Album

    Guadala Harry, Feb 22, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    460
    Bryan Donaldson
    Feb 23, 2004
  3. Mike Chan

    Microsoft photo album

    Mike Chan, Mar 10, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,951
    Mike Chan
    Mar 11, 2005
  4. Bruce Chastain
    Replies:
    6
    Views:
    430
    Bruce Chastain
    Oct 27, 2003
  5. Peddler

    Photo Album

    Peddler, Oct 27, 2003, in forum: HTML
    Replies:
    6
    Views:
    643
    Jerry Perkins
    Oct 29, 2003
Loading...

Share This Page