I'm currently building my portfolio site, and I'm having a little difficulty, basically I have two small problems...
I cant get the background position to animate in the y axis when the position contains a "center" attribute on the x axis
I cant get the effect to happen while scrolling ,pause when I stop scrolling, and continue when I continue to scroll
Here is the code i'm using:
//Top section parallax
$(function parallaxInnerAnimation(){
//Reset the background position
$('#first-canvas .inner').css({backgroundPosition: 'center 0px'});
//Set the animations
$(window).scroll(function() {
$('#first-canvas .inner').animate({
backgroundPosition:"(center -200px)"
}, 5000, 'linear');
});
});
I'm using the jquery.backgroundPosition plugin v1.22 by Alexander Farkas, and jQuery 1.6.1.
This site is css3 and html5, and is mainly meant to support IE9, Firefox 4, and Chrome 11 etc... I'm making a different site for older browsers so backwards compatibility can be sacrificed
Sorry if its a dumb question, I'm not really a developer, more of a designer who can code front end stuff, thanks in advance.
UPDATE:
To put it in context, I have now placed it on my live server http://charlieryan.co.uk/stack-overflow/
line 42 of backgroundPosition.charlieryan.js: res is null
. This might be your issue. – Berna