1

How do I control a window by mouse movement in javascript?? I mean the page should auto scroll on moving the mouse.

1 Answers1

0

This can be done using parallax like in this http://www.franckmaurin.com/the-parallax-effects-with-jquery/

You are not actually controlling a window but divs.

Here is a sample basic code:

// Variables for current position

var x, y;

function handleMouse(e)
{
if (x && y) 
{
   window.scrollBy(e.clientX - x, e.clientY - y);
}
x = e.clientX;
y = e.clientY;
}

document.onmousemove = handleMouse;
gopi1410
  • 6,567
  • 9
  • 41
  • 75