I have a background image on a div and I would like to change its position from center bottom to center top when I mouse over the link which is in the div.
I don't speak jQuery very well, I am kind of like the American in France, knowing little more than parlez vous, but here goes.
Here is the html:
<div class="video-link">
<a href="#">Watch the Pack It Videos Now.</a>
</div>
Here is the CSS:
.video-link {
width: 610px;
height: 68px;
background: url(../_images/btn_horz-video.png) no-repeat center bottom;
margin: 10px 0 10px 50px;
}
.video-link a {
color: #000;
text-decoration: none;
border: none;
font-size: 18px;
display: block;
padding: 25px 0 0 90px; font-weight: bold; }
And last but not least, here is the jQuery:
$(".video-link a").hover(function() {
$(this).closest(".div").css({ 'background-position': 'top center' });
}, function() {
$(this).closest(".div").css({ 'background-position': 'bottom center' });
});
Here is the page - It is the Watch the Pack It Videos Now image about midway down the page.
Thanks.