Scrolling content without scrollbars - possilbe ?

G

gegaenator

Is there any way to scroll browser's (or div's) content with disabled
scroll bars ? Jumping on lines through JavaScript or etc.. I mean about
some good performance method.

Cheers,
Paul Gega
 
G

Georgi Naumov

Yes you can see here:
http://developer.mozilla.org/en/docs/DOM:element.scrollTop
and here:
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/scrolltop.asp
This is my small example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
#mydiv{
width: 80px;
height: 50px;
overflow: hidden;
float: left;
margin-left: 150px;
}
#buttons{
float: left;
}
</style>
<script type="text/javascript">
function scrollObj(aObj,aTop)
{
if(aTop)
aObj.scrollTop+=5;
else
aObj.scrollTop-=5;
return false;
}
</script>
</head>

<body>
<div id="mydiv">
I'm one veryyyyyyyyyyyyy logn
lineeeeeeeeeeeeeeeeee
lineeeeeeeeeeeeeeeeee
lineeeeeeeeeeeeeeeeee
lineeeeeeeeeeeeeeeeee
</div>
<div id="buttons">
<a href="test.html" onclick="return
scrollObj(document.getElementById('mydiv'),true);">Scrroll top</a><br
/>
<a href="test.html" onclick="return
scrollObj(document.getElementById('mydiv'),false);">Scrroll bottom</a>
</div>
</body>
</html>


(e-mail address removed) напиÑа:
 
P

Paul Gega

СПÐСИЪО, Georgi !

And if want to do It animated, i should use it with simpe loop ? I am
asking becouse I was only scripting animations in Action Script.

Cheers!


Georgi Naumov napisał(a):
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top