Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: CSS Popup Image Viewer

  1. #1
    Join Date
    Aug 2006
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS Popup Image Viewer

    1) Script Title: CSS Popup Image Viewer


    2) Script URL (on DD): http://www.dynamicdrive.com/style/cs...-image-viewer/

    3) Describe problem: I need to be able to add a buy now link and a more offers link to the pop up image text, so far ive tried but with no luck can anyone assist?

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    That is because you cannot have an anchor inside another anchor. Try replacing the anchor with a div container:
    HTML Code:
    <div class="thumbnail">Hover to view image
    <span><img src="http://www.google.com/intl/en_ALL/images/logo.gif" /><br />
    Image Text <a href="http://www.google.com">Google</a></span>
    </div>

  3. #3
    Join Date
    Aug 2006
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Snookerman View Post
    That is because you cannot have an anchor inside another anchor. Try replacing the anchor with a div container:
    HTML Code:
    <div class="thumbnail">Hover to view image
    <span><img src="http://www.google.com/intl/en_ALL/images/logo.gif" /><br />
    Image Text <a href="http://www.google.com">Google</a></span>
    </div>
    Thanks for your assistance Snookerman.

    But i still have a problem, when i change the anchor to a DIV it wont validate because im coding in XHTML 1.0 Transitional and the class="thumbnail" is not allowed to be placed within a DIV tag.

    I went a head an tried it anyway, but instead of lining up in three rows of three the images displayed in a centered single row.

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Quote Originally Posted by Dazza30 View Post
    But i still have a problem, when i change the anchor to a DIV it wont validate because im coding in XHTML 1.0 Transitional and the class="thumbnail" is not allowed to be placed within a DIV tag.
    What? You can place any class in a div tag. You must have made some other mistake. Here is the code in a xhtml 1.0 transitional page, go ahead and validate it:
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <div class="thumbnail">Hover to view image <span><img src="http://www.google.com/intl/en_ALL/images/logo.gif" alt="" /><br />
      Image Text <a href="http://www.google.com">Google</a></span> </div>
    </body>
    </html>
    Please post a link to your site, or attach your code, and I will try to help you validate it.

  5. #5
    Join Date
    Aug 2006
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I highlighted the wrong part of the code.

    Heres the pop up image viewer html im working with and the offending code highlighted in red, which wont validate when i change the a tag to a div.

    <div class="style24" style="left: 0px; top: 10px">

    <a class="thumbnail" href="#thumb"><img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <a class="thumbnail" href="#thumb"><img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <a class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <br/>
    <br/>
    <a class="thumbnail" ><img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <a class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <a class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <br/>
    <br/>
    <a class="thumbnail" href="#thumb"><img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <a class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <a class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></a>

    <br />


    </div>

  6. #6
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Could you post the code after you have changed it, i.e. the one that won't validate?

  7. #7
    Join Date
    Aug 2006
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This time i changed the a tags to divs and highlighted the offending code in red again, but i also added the hyper link where i need it to go.

    <div class="style24" style="left: 0px; top: 10px">

    <div class="thumbnail" href="#thumb"><img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />Some text<a href="www.myhomepage.com" target="_blank">some text</a></span></div>

    <div class="thumbnail" href="#thumb"><img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></div>

    <div class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></div>

    <br/>
    <br/>
    <div class="thumbnail" ><img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></div>

    <div class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></div>

    <div class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></div>

    <br/>
    <br/>
    <div class="thumbnail" href="#thumb"><img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></div>

    <div class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></div>

    <div class="thumbnail" href="#thumb">
    <img alt="" src="images6/6500slps3gta.jpg"/><span><img alt="" src="images6/6500slps3gta.jpg" width="329" height="218" /><br />some text</span></div>

    <br />


    </div>

  8. #8
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Your problem is the part you marked in red. You cannot have a href value for div containers, only for anchors.

  9. #9
    Join Date
    Aug 2006
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Snookerman View Post
    Your problem is the part you marked in red. You cannot have a href value for div containers, only for anchors.
    Problem is though the href part of the code is suppost to be there, if i cant change the a tag and get the images to dispaly properly im going to have to scrap it.

  10. #10
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Quote Originally Posted by Dazza30 View Post
    Problem is though the href part of the code is suppost to be there
    Are you sure? I can't see any reason for why it should be there. Have you tried removing it to see what happens?

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
  •