Web Analytics Made Easy -
StatCounter scrollLeft - scrolling a div - CodingForum

Announcement

Collapse
No announcement yet.

scrollLeft - scrolling a div

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • scrollLeft - scrolling a div

    I have this simple script for scrolling a div:
    Code:
    function ScrollLeft()
    {
      Timer = setInterval("document.getElementById('scroller').scrollLeft -= 2", 15);
    }
    function ScrollRight()
    {
      Timer = setInterval("document.getElementById('scroller').scrollLeft += 2", 15);
    }
    It works cross browser, but it breaks pretty easily if you fiddle with it a bit
    Anyone got a better method of scrolling a div or a way of fixing this one. I was drawn to this method for its simplicity.
    99 times out of 10!
Working...
X