I want to make something similar to the CSS/JQUERY effect that you can see in the following error link:
http://new.livestream.com/error
What I want to know is how I can make the background image move according to the mouse position and using JQUERY. I have seen some code that could help me but since I m not very keen on JQUERY I ask for some help. I post the code:
$(document).ready(function(){
$( #home a )
// On mouse over, move the background on hover
.mouseover(function(){
$(this).stop().animate({backgroundPosition: "0 -54px"}, 500);
})
// On mouse out, move the background back
.mouseout(function(){
$(this).stop().animate({backgroundPosition: "0 0"}, 500);
})
});
我猜测,我必须把固定的“0 -54px”价值改变为一种动态价值,根据目前的土地使用情况正确?
最佳做法