Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollbar heigth

Status
Not open for further replies.

sherlock1305

Programmer
Jul 10, 2001
21
0
0
CA
Hi,

first, sorry for my english, it's not my first language!

Here is my question.
Is there a way to control the scroll bar when clicking on it???

I've tried this code...

<SCRIPT>
function ComponentSnapShot(){
var sElem = &quot;&quot;;
sElem = document.body.componentFromPoint(event.clientX, event.clientY);
if (sElem==&quot;scrollbarDown&quot;)
{
window.scrollBy(0,1200);
// alert(&quot;1&quot;);
}
if (sElem==&quot;scrollbarUp&quot;)
{
window.scrollBy(0,-1200);
// alert(&quot;2&quot;);
}
if (sElem==&quot;scrollbarPageDown&quot;)
{
window.scrollBy(0,20);
// alert(&quot;3&quot;);
}
if (sElem==&quot;scrollbarPageUp&quot;)
{
window.scrollBy(0,-20);
// alert(&quot;4&quot;);
}
}
</SCRIPT>
</HEAD>
<BODY onmousedown=ComponentSnapShot() LANGUAGE=javascript>

...but it just works with &quot;Alerts&quot;?!?!?
Does anyone know why?
...or anyone has another solution???

Thanks a lot.
Sherlock
 
What exactly are you wanting to control about the scroll bar. The number of pixels that it can scroll?
 
Hi,

Yes, exactly,
I want to control the number of pixel my scroolbar scrolls down or scrolls up.

Thanks again!
Sherlock
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top