Background image position animation
Hi guys,
I'm new to jQuery and would need some help.
I made a div element, and I want to make the background image move up and down vertically continuously.
I have this script, which makes the background image move up, just how I would like to:
<script>
$('#oblici').animate ({
'background-position-x': '0px',
'background-position-y': '-42px'
}, 2000, 'linear');
</script>
I would like to make the background image animate back to the beginning position after it reached the top position.
Also it would be good if the back and forth animation would repeat continuously (loop).
I tried on many ways to achieve that, but I got stucked.
Any help would be much appreciated.
Thank you!