how to trigger a Lightbox2 gallery from a scripted menu?

Discussion in 'Web Design and Development' started by djsound, Jan 25, 2011.

  1. djsound macrumors 6502a

    djsound

    Joined:
    Dec 4, 2006
    #1
    I want to open up a Lightbox2 gallery from the "photo" part of this menu on top of my page but I dont know how. I have done it before from a regular image...but no idea on this..anyone have a clue? =)

    http://barnoneranches.com/
     
  2. manueld macrumors 6502

    Joined:
    Jun 8, 2009
    #2
    just link the nav to first image of the gallery with the rel="lightbox".

    ex:
    <a href="path-to-first-image.jpg" rel="lightbox" title="photos">Photos</a>
     
  3. djsound thread starter macrumors 6502a

    djsound

    Joined:
    Dec 4, 2006
    #3
    I got it to work but the gallery is supposed to have multiple photos...usually I put all the photos under the first line....I did this and the photos do work in the gallery but as you can see it added lines to the menu button......any ideas? thanks
     

    Attached Files:

  4. brisbaneguy29, Feb 1, 2011
    Last edited by a moderator: Feb 1, 2011

    brisbaneguy29 macrumors 6502

    brisbaneguy29

    Joined:
    Nov 27, 2007
    Location:
    Brisbane
    #4
    Try This

    PHP:
    <ul>
        <
    li><a href="../images/gallery/001.jpg" rel="lightbox[photos]">PHOTOS</a></li>
        <
    li><a href="../haysales.html" >HAY SALES</a></li>
        <
    li><a href="../contact.html" >CONTACT</a></li>
    </
    ul>

    a href="../images/gallery/005.jpg" rel="lightbox[photos]"></a>
    a href="../images/gallery/aq2.jpg" rel="lightbox[photos]"></a>
    a href="../images/gallery/arena.jpg" rel="lightbox[photos]"></a>
    a href="../images/gallery/bred1.jpg" rel="lightbox[photos]"></a>
    a href="../images/gallery/breeding-barn.jpg" rel="lightbox[photos]"></a>
     
  5. djsound, Feb 1, 2011
    Last edited by a moderator: Feb 1, 2011

    djsound thread starter macrumors 6502a

    djsound

    Joined:
    Dec 4, 2006
    #5
    I just put the other lines at the bottom of the page before the closing body tags and it seems to work. thanks brisbaneguy =)

    PHP:
    <a href="images/gallery/005.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/aq2.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/arena.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/bred1.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/breding-barn.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/breeding-stalls.jpg" rel="lightbox[photos]" ></a>
     <
    a href="images/gallery/early-morn-2.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/early-morn.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/front.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/hyb6.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/lane.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/paddocks-12.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/paddocks-7.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/paddocks-8.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/s11.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/s1head2.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/s1paddock-2.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/s2-paddock.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/s2.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/s2head2.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/s3.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/s3head.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/second-five.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/second-three.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/second.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/stud-stalls.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/t1.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/t2.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/t3.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/vet.jpg" rel="lightbox[photos]" ></a>
    <
    a href="images/gallery/view.jpg" rel="lightbox[photos]" ></a>
    </
    body>
    </
    html>
     

Share This Page