<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Scroll Check</title>
<script>
function getDocHeight() {
var D = document;
return Math.max(
D.body.scrollHeight, D.documentElement.scrollHeight,
D.body.offsetHeight, D.documentElement.offsetHeight,
D.body.clientHeight, D.documentElement.clientHeight
);
}
window.onscroll = function()
{
var scrollTop = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
if(scrollTop >= getDocHeight()/2)
{document.getElementById('scrollerbutton').src="http://www.itistheride.com/Rbanlogo/up1.png"}
else
{document.getElementById('scrollerbutton').src="http://www.itistheride.com/Rbanlogo/down1.png"}
}
</script>
</head>
<body>
<div style="position: absolute; height: 320%; background: red; "> </div>
<img id="scrollerbutton" alt="" src="http://www.itistheride.com/Rbanlogo/down1.png" style="position: fixed; right: 1px; top: 50%">
</body>
</html>
Bookmarks