Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Javascript mousedown and continuous actions

  • 07-12-2007 07:57PM
    #1
    Closed Accounts Posts: 658 ✭✭✭


    Hi

    I'm having a bit of a problem with javascript. I want to implement a scroll function for a group of thumbnail images kept in a div with a certain height. I have a 'down' button, and when the user clicks (onmousedown), I want these thumbnail images to scroll.

    I have code in a function to shift the div up one pixel. I have attached a behaviour to this down button so that onmousedown, it will continually scroll the div, which is something like it is below.
    scroll_button.onmousedown = function()
    {
         scrollDown();
    }
    

    My problem is that the div only moves once, instead of continually like I want it to. Surely if I wanted it to move once, I would use onclick instead. Google actually shows nothing on this for some strange reason. Is there anything simple I am missing. I tried using the setTimeout() function but that didn't make a difference.

    Thanks


Comments

Advertisement