Immature() does not work with href

Asked

Viewed 48 times

2

Hello, I have a script that is an image slideshow with a animate() to the top. works 100%. but if I add a <a href="#"> in the image. the effect to. could you help me? it keeps working

http://jsfiddle.net/d4n7dcnf/12/

  • 2

    In my experience, a a around a img does not automatically assume the size of img. But it could be something else. There’s an example of him nay working? (i.e. an example of how you tried to do it and it didn’t work out) By the way, if you can post the most relevant piece of code in the same question instead of an external link, it would be good (the link can follow, help a lot, it would only be better if it wasn’t only the link).

  • Behold this, There’s an example that doesn’t work already with the tags added ?

1 answer

1


The effect for the following reason:

HTML tagged <a>:

<div>
    <div id="container">
      <a href="#"><img src="http://duvaleimoveis.com.br/admin/dest/thumb.php?img=fotos/3a8d87a624cfd7dc68bcbd1c2d45ebee.jpg"/></a>

      <a href="#"><img src="http://duvaleimoveis.com.br/admin/dest/thumb.php?img=fotos/f15d8f97b154858f411c17ef999ae5ab.jpg"/></a>

  </div>
</div>

The tag <img> becomes children of a and a children container and in CSS the is who should be as position absolute, then in the CSS line:

#container > img
{
    position: absolute;
    left: 0;
    top: 0;
}

change to:

#container >  a
{
    position: absolute;
    left: 0;
    top: 0;
}

note that your code will continue to work normally http://jsfiddle.net/d4n7dcnf/16/

  • 1

    thank you very much. I hadn’t thought of that. vlw

  • I don’t deserve +1 no?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.