Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Javascript mousedown and continuous actions

Options
  • 07-12-2007 7: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