I'm using jQuery to Animate an image while hovering it. I need it to be able to be re-sized/scaled with the browser. The problem is that I cant get overflow:hidden to work because I don't have a fixed height on my div. I want the width to be 100% and I need the height to be 50% of the width of the div. Please help
Link to my example http://www.jasalounge.com/tester/
$(function(){
$("#box1 a").hover(function(){
$("img", this).stop().animate({top:"-50%"},{queue:false,duration:150});
}, function() {
$("img", this).stop().animate({top:"0px"},{queue:false,duration:150});
});
});
#box1 {
width:100%;
max-width:250px;
border:none;
overflow:hidden;
}
#box1 img {
width:100%;
position:relative;
}
<div id="box1"><a href="#"><img src="images/test3.png" alt="test"/></a></div>