/    Sign up×
Community /Pin to ProfileBookmark

Mouse follow possible?

I am new to javascript, and when posed with a problem I could not think of any other scripting to achieve the result in.

My friend has a website that is rather long (not blog long, but long enough scrolling is required)
He wanted to know if there was a script that would make the page auto scroll if the visitor went towards the bottom of the page (downward motion)

Is this possible? And if so, how do I do it?

Any help would be greatly appreciated.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@james_d_kellySep 09.2005 — I found this which works ok, try it...


<html>

<head>

<script language="JavaScript"><!--

if (document.layers) {

document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = myScroll;

}

var last = (new Date()).getTime();

function myScroll(e) {

var now = (new Date()).getTime();

if (document.layers && now > (last + 100)) {

window.scrollTo(e.screenX - window.screenX - (window.outerWidth - window.innerWidth),e.screenY - window.screenY - (window.outerHeight - window.innerHeight));

last = now;

}

else if (document.all && now > (last + 100)) {

window.scrollTo(window.event.x,window.event.y);

last = now;

}

}//--></script>

</head>

<body onMouseMove="myScroll()">

<!-- Your html code-->

</body>

</html>
×

Success!

Help @andrewwebber spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...