I just created Fiddle to show you what I had in mind with my comment on your question. You should be able to move on from there.
document.addEventListener('mousemove', function (event) { if (window.event) { // IE fix event = window.event; } // Grab the mouse X-position. var mousex = event.clientX; var header = document.getElementById('header'); header.style.backgroundPosition = mousex/3 + 'px 0'; }, false);
How to explain what is going on here:
- It binds a function in the
mousemove event on document . - It captures the current mouse position using
event.clientX . - Changes the background position of the
#header element at 1/3 speed ( mousex/3 ).
Check it out live: FIDDLE
If you want to get the same thing as the website associated with you, you should have several sections above each other and move their background positions at a different speed. In this example, it moves 1/3 of the speed of the mouse.
source share