i have the following code to grow an image after you hover it:
$(".myImage").hover(function () {
$(this).find('img').stop() /* Add class of "hover", then stop animation queue buildup*/
.animate({
width: '560px', /* Set new width */
height: '174px', /* Set new height */
padding: '20px'
}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */
}, function () {
$(this).find('img').stop() /* Remove the "hover" class , then stop animation queue buildup*/
.animate({
width: '140px', /* Set width back to default */
height: '44px', /* Set height back to default */
padding: '5px'
}, 400);
});
but the issue is that when the image grows it shows up behind another image (which happens to be a background image) that is to the left of item . . the css on the other image that is showing up over this image is:
.otherImage {
background: url("/Content/Images/main1.png") repeat scroll 0 0 transparent;
display: block;
height: 506px;
margin-left: auto;
margin-right: auto;
margin-top: 30px;
position: relative;
width: 527px;
z-index: 0;
}
How can i get the image that is calling animate to hover over this background image?
Here is the original css of the image that get called to animate (copied from firebug)
element.style {
display: inline-block;
height: 44px;
left: 0;
margin-left: 0;
margin-top: 0;
padding: 5px;
top: 0;
width: 140px;
}
.myImage img {
height: 44px;
width: 140px;
z-index: 999;
}
a img {
border: medium none;
}
If the object you are animating is
position: absolute, then you can set it’sz-indexto a higher value than the other object and it will be on top.If it’s not
position: absolute, then we will have to see the relevant HTML markup and all the CSS styling on those two objects to know what your options are.