Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
/*<![CDATA[*/
.left {
position:fixed;left:50px;bottom:50px;width:50px;height:50px;background-Color:red;
}
.right {
position:fixed;right:50px;bottom:50px;width:50px;height:50px;background-Color:red;
}
/*]]>*/
</style>.left
</head>
<body>
<div class="left" onmouseover="scrollwindow.spd=-10;" onmouseout="scrollwindow.spd=0;"></div>
<div class="right" onmouseover="scrollwindow.spd=10;" onmouseout="scrollwindow.spd=0;"></div>
<div style="width:5000px;height:50px;background-Color:red" >
</div>
<script type="text/javascript">
/*<![CDATA[*/
function scrollwindow(){
if (scrollwindow.spd&&typeof(scrollwindow.spd)=='number'){
window.scrollBy(scrollwindow.spd,0);
}
}
setInterval(function(){ scrollwindow(); },50);
/*]]>*/
</script>
</body>
</html>
or
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
/*<![CDATA[*/
.left {
position:fixed;left:50px;bottom:50px;width:50px;height:50px;background-Color:red;
}
.right {
position:fixed;right:50px;bottom:50px;width:50px;height:50px;background-Color:red;
}
.up {
position:fixed;left:50px;top:150px;width:50px;height:50px;background-Color:red;
}
.down {
position:fixed;right:50px;top:150px;width:50px;height:50px;background-Color:red;
}
/*]]>*/
</style>.left
</head>
<body>
<div style="width:5000px;height:5050px;background-Color:blue" >
</div>
<div class="up" onmouseover="scrollwindow(0,-10);" onmouseout="scrollwindow();">Up</div>
<div class="down" onmouseover="scrollwindow(0,10);" onmouseout="scrollwindow();">Down</div>
<div class="left" onmouseover="scrollwindow(-10,0);" onmouseout="scrollwindow();">Left</div>
<div class="right" onmouseover="scrollwindow(10,0);" onmouseout="scrollwindow();">Right</div>
<script type="text/javascript">
/*<![CDATA[*/
function scrollwindow(x,y){
clearTimeout(scrollwindow.to);
if (typeof(x)=='number'&&typeof(y)=='number'){
window.scrollBy(x,y);
scrollwindow.to=setTimeout(function(){ scrollwindow(x,y); },50);
}
}
/*]]>*/
</script>
</body>
</html>
Bookmarks