Onclick for CSS Image Gallery

Discussion in 'CSS' started by jj1, Nov 11, 2009.

  1. #1
    I have created a CSS image gallery that works great when a thumbnail is hovered over. Is there any way of making it work for when you click a thumbnail as well?

    I have tried using a:active and this works in ie but not in Firefox.

    Is there any form of - easy - Javascript out there that would add on to this to support an onclick state??????
     
    jj1, Nov 11, 2009 IP
  2. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What is your current site. You will need to have <a href="thepageyouwanttogoto.theextension">image</a>. Or you can use an onclick attribute for JavaScript.
     
    LeetPCUser, Nov 12, 2009 IP
  3. jj1

    jj1 Active Member

    Messages:
    892
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    portfolio - for this css gallery, the a:active works in some web browsers (not all) until the mouse is clicked anywhere on screen and then it goes back to the default image; for some browsers it doesn't work at all.

    I am now wanting to design a different website for a customer using a css gallery which has a proper onclick function - with this, the onclick would be more central tot he design and not just an addon as here.
    - I don't want it to go to a new page, just to display a larger image when the thumbnail is clicked.
     
    jj1, Nov 13, 2009 IP
  4. b4db0y

    b4db0y Notable Member

    Messages:
    3,523
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    205
    #4
    you shud use some type of jquery for this.
     
    b4db0y, Nov 13, 2009 IP
  5. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Something like this: http://www.huddletogether.com/projects/lightbox2/ ?
    When you click on the image a larger image opens up.
     
    wd_2k6, Nov 13, 2009 IP
  6. jj1

    jj1 Active Member

    Messages:
    892
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #6
    wd 2k6 - many thanks for this, but no lightbox is NOT what I am after.

    I want a large image to appear in a specific box and location (as per css gallery) not blanking out the screen and centred as per lightbox.

    Does anyone know how to do this? I'm afraid I can't write a jquery.
     
    jj1, Nov 18, 2009 IP