When I move the .thumbnail divs outside of the #thumbhider and #thumbcontent divs, the click events function correctly. Currently, they are not working as expected.
Website URL:
I believe the issue may be related to the overflow:hidden property on the containing div. How can I resolve this?
Javascript code:
//this is within $(document).ready function
$(".thumbnail").click(function () {
var IMAGE_DIR = "images/guitars/";
var img = $(this).find("img").attr("alt");
$("#mainphoto").attr("src", IMAGE_DIR + img);
if(captions) {
$("#imgcaption").text(captions[img]);
}
});
CSS code:
div.thumbnail { background-color: #000000; padding: 1px; float: left; width: 69px; height: 69px; cursor: pointer; }
div#thumbhider { width: 673px; height: 70px; overflow: hidden; margin: 0 auto; margin-top: 19px; position: relative; }
div.thumbcontent { height: 70px; background-color: #00ff00; width: 0 auto; display: inline; position: relative; }
HTML code:
<div id="thumbhider">
<div class="thumbcontent">
<div style="margin-right:15px;" class="thumbnail"><img alt="1.png" src="thumber.php?img=images/guitars/1.png&h=69&w=69"></div>
<div style="margin-right:15px;" class="thumbnail"><img alt="10.png" src="thumber.php?img=images/guitars/10.png&h=69&w=69"></div>
<!--etc....-->
<div style="clear:both;"></div>
</div>
</div>