SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    multiple hrefs on one image

    how would i go about adding additional hrefs to each image within div A?

    <a href="#A">
    <div id="A">
    <img src="http://www.philipdusel.com/images/ps26.jpg" alt="Title #14" />
    <img src="http://www.philipdusel.com/images/ps19.jpg" alt="Title #14" />
    </div>
    </a>

    the above code if from

    http://philipdusel.com/ddpp.html
    the additional hrefs im curious about are needed for my galleriffic image gallery

    as of now if i put an href on one of the images it just goes to that and ignores the <a href="#A">

    is this possiple without Javascript?

    Thanks

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,200
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Something has gone wrong there. That's not how Galleriffic normally works. I suggest you start with the Galleriffic code and modify it to suit.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Something has gone wrong there. That's not how Galleriffic normally works. I suggest you start with the Galleriffic code and modify it to suit.



    here is my galleriffic http://www.philipdusel.com/v2.html id like to put the thumbs in the
    <a href="#A">
    <div id="A"></div></a>
    from my first post. so when "div A" is clicked it scrolls into view and also calls the href for the main image(gallerfiffic behavior)
    i tried starting with the galleriffic but have the same problem of calling two hrefs at the same time

    the thumbanail section from galleriffic is
    <div id="thumbs" class="navigation">

    <ul class="thumbs ">

    <li>
    <a class="thumb" name="n22" id="n22" href="http://www.philipdusel.com/images/pm26.jpg" title="Title #14">
    <img src="http://www.philipdusel.com/images/ps26.jpg" alt="Title #14" />
    </a>
    <div class="caption">
    <a rel="cbviewer" class="group1" title="" onclick="return false;" href="http://philipdusel.com/images/pot.jpg"><div class="download">
    Full Size

    </div></a>

    <div class="image-title">Title #14</div>
    <div class="image-desc">Description</div>
    </div>
    </li></ul></div>



    this just calls the href for the larger image

    <a href="#A">
    <div id="A">
    <li>
    <a class="thumb" name="n22" id="n22" href="http://www.philipdusel.com/images/pm26.jpg" title="Title #14">
    <img src="http://www.philipdusel.com/images/ps26.jpg" alt="Title #14" />
    </a>
    <div class="caption">
    <a rel="cbviewer" class="group1" title="" onclick="return false;" href="http://philipdusel.com/images/pot.jpg"><div class="download">
    Full Size

    </div></a>

    <div class="image-title">Title #14</div>
    <div class="image-desc">Description</div>
    </div>
    </li>



    <li>
    <a class="thumb" name="n22" id="n22" href="http://www.philipdusel.com/images/pm26.jpg" title="Title #14">
    <img src="http://www.philipdusel.com/images/ps26.jpg" alt="Title #14" />
    </a>
    <div class="caption">
    <a rel="cbviewer" class="group1" title="" onclick="return false;" href="http://philipdusel.com/images/pot.jpg"><div class="download">
    Full Size

    </div></a>

    <div class="image-title">Title #14</div>
    <div class="image-desc">Description</div>
    </div>
    </li>
    </div>
    </a>

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.philipdusel.v3.html



    why can't i do this?


    <a href="#B" >
    <div id="B">
    <a class="thumb" href="http://farm2.static.flickr.com/1260/930424599_e75865c0d6.jpg" title="Title #23"><img src="http://www.philipdusel.com/images/ps21.jpg" alt="Title #14" /></a>
    </div>
    </a>

  5. #5
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,207
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    I've never used Galleriffic, so I'm not sure how much help I'm going to be here, but I'll try. I'm still not very clear what you're trying to achieve. Are you trying to have multiple slideshows on the one page?

  6. #6
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by phillycheese123 View Post
    how would i go about adding additional hrefs to each image within div A?

    <a href="#A">
    <div id="A">
    <img src="http://www.philipdusel.com/images/ps26.jpg" alt="Title #14" />
    <img src="http://www.philipdusel.com/images/ps19.jpg" alt="Title #14" />
    </div>
    </a>
    The first problem is that that is not valid code. You can't have any block level elements (eg <div>) inside an <a>, only text and inline elements (eg <b>, <img>). You should instead wrap the <a> around just the <img> tag that it relates to, and that way it's very easy to put the extra <a>s in there.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •