You can get the position of the mouse pointer relative to the left of document with event.pageX
and set the scroll using scrollLeft()
:
$(document).mousemove(function (e) {
var winW = $(window).width(),
docW = $(this).width(),
i = docW / winW, //increment value
x = (e.pageX - $(window).scrollLeft()) * i;
$(window).scrollLeft(x);
});
See this demo: http://jsfiddle.net/m28EY/4