The parallax script doesn't update the css on $(window).scroll
. It seems like you can not add multiple background-positions with jQuery?
Parallax scroll script:
<script>
var top_header = '';
$(document).ready(function(){
top_header = $('header');
});
$(window).scroll(function () {
var st = $(window).scrollTop();
top_header.css({'background-position':"left "+(st*.5)+"px,"});
});
</script>
CSS:
header {background-image: url(../images/1.png), url(../images/2.png);
background-repeat: no-repeat, no-repeat;
background-position: left, right;
height: 550px; width: 100%}
I've tried to update the css like this:
$(window).scroll(function () {
var st = $(window).scrollTop();
top_header.css({'background-position':"left "+(st*.5)+"px,"+","+"right "+(st*.5)+"px,"});
});
This brakes the code and the header's background-position doesn't update on scroll as it should.
Any ideas appreciated.