scrollbar from images

M

maz

I want to make a scrollbar out of 3 pictures :
- one for 'up'
- one for 'down'
- one for the cursor between

end it's precisely the last one which makes trouble...
How to make it move along the text ?
And how to get the length of a div's content... ?

Have you seen any website implementing this ?


here is the idea of my script, only works for up and down :


<!-- script -->

var scrollAmount = 1;
var i = 0;

function move_up() {
document.getElementsByTagName('div')[9].scrollTop += scrollAmount;
scrollAmount += i;
i += 1/100;
timeoutID1 = setTimeout("toUp()", 10);
}

function move_down() {
document.getElementsByTagName('div')[9].scrollTop -= scrollAmount;
scrollAmount += i;
i += 1/100;
timeoutID2 = setTimeout("toDown()", 10);
}

function clear_up() {
clearTimeout(timeoutID1);
i = 0; scrollAmount = 1;
}

function clear_down() {
clearTimeout(timeoutID2);
i = 0; scrollAmount = 1;
}


<!-- first div which has to scroll - floated right -->
<div id="content">
content with unknown length
</div>

<!-- second div which contains the scroll bar -->
<div id="scrollbar">

<a onMouseOut="clear_down();"
onMouseUp="clear_down();"
onMouseDown="move_down();">
<img src='goutte_haut.jpg' alt='' name='goutte_haut'/>
</a><br/>

<img src='goutte_milieu.jpg' alt=''/><br/>

<a onMouseOut="clear_up();"
onMouseUp="clear_up();"
onMouseDown="move_up();">
<img src='goutte_bas.jpg' name="goutte_bas" alt='' />
</a>

</div>
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top