0

Hi,

I am developing a website that allows users to be able to navigate the website by only clicking on a soft switch. All links are rotated through an array when a link is highlighted and the user clicks the link it is selected. I need to be able to scroll the div1 contents up and down by use of an onmousedown event but I am not sure where to put it? Should it be in the javascript code or should it be placed when calling the javascript from the array.

*The user clicks on rotate8

<img src="images/scrollup1.jpg" name="Rotate9" width="70" height="70" id="Rotate9">___
<img src="images/scrolldown1.jpg" name="Rotate8" width="70" height="70" id="Rotate8"></a></a>

*This says to the the array7 to run the javascript 

arrayLinks[7]="javascript:scrollDivDown(id)";
arrayLinks[8]="javascript:scrollDivUp(id)";

*This is the javascript

<script>
defaultStep=1
step=defaultStep
function scrollDivDown(id){
document.getElementById(id).scrollTop+=step 
timerDown=setTimeout("scrollDivDown('"+id+"')",5)
}


function scrollDivUp(id){
document.getElementById(id).scrollTop-=step
timerUp=setTimeout("scrollDivUp('"+id+"')",5)
}
</script>

But where should I put the mousedown event as it is not working and I have tried different ways.
Any help would be great thank you.

2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by James456
0

well, it's not really Java related.
there are multiple jQuery libraries out there that you can use to get this kind of functionality, have you checked those out?

0

Opps sorry wasn't to sure what category I should put it under. Well I wouldn't be to sure of where to look for this type of functionality. Would I not have the same issue of not knowing where to put the onmousedown event? Thanks for your help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.