jquery, change BG pos using scroll()

Associate
Joined
4 Dec 2009
Posts
215
Hello all,

I've run into a little trouble and if anyone has some idea's that be fantastic,

basically I love plain and simple jquery to make little things come to life and the current project I'm working on won't play ball.

At the moment I have a .hover that flips the background image from left to right when you reach the bottom div, it works fine, but if the user doesn't move the mouse, the browser won't move the bg, even if they scroll directly onto the div.

The only way I can think of it working would be to have a (div).scroll()function


Code:
$(function() {
	$('#end').hover(function() {
                  $('#wrapper').animate({backgroundPosition: 'right'});
        });
});

Cheers
 
Back
Top Bottom