Thanks again – Kevin
]]>trying to get this working, but on scroll the image jumps down 50px then scrolls up…
here’s what I have:
function calcParallax(tileheight, speedratio, scrollposition) {
return ((tileheight) – (Math.floor(scrollposition / speedratio) % (tileheight+1)));
}
window.onload = function() {
window.onscroll = function() {
var posX = (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : window.pageXOffset;
var posY = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : window.pageYOffset;
var ground = document.getElementById(‘ground’);
var groundparallax = calcParallax(50, 12, posY);
ground.style.backgroundPosition = “0 ” + groundparallax + “px”;
document.getElementById(‘javascriptcode’).style.backgroundPosition = groundparallax + “px 0”;
}
}
any ideas?
]]>Really appreciate your script. finally something working without java and without needing to resize my window… Thanks!
I’m trying since 2 hours and don’t seem to find the answer
how to make this work for X-axis…
Is there any way?
Please let me know.
Cheers, Dirk
otherwise, works great!
]]>trice: Seems to work for me, although not as fluidly as it’s probably supposed to. I’m same setup as you, tried in both Opera 9.1 and FF 2.0.0.3
]]>Anyway, I’ll be working across the street from Natcoll starting from next week. Might see you around.
]]>