0 Replies Latest reply on Aug 17, 2009 8:41 AM by scboy

    Scroll bar maths?!

    scboy Level 1

      I have the code below that i am looking to try to amend to use my custom scroller, any one able to help me figure out what code i need to know to make it work for me properly? using it in its current state it does move the bar up and down, and display all the relevant info, its just the bar doesnt visually appear at the bottom or top of the window (only the middle). I figure it will be something to do with the variables not matching my dimensions, but i cant suss it. :hmm:


      Can anyone tell me what i need to know and what variables i need to change to get this thing to work?


      function updateScroller(type) {
      var a = target.scroll;
      var b = target.maxscroll;
      var c = 110;
      var d = scroller._y;
      if (type == "mid") {
      target.scroll = Math.round((b*(d/c))+1);
      } else {
      scroller._y = c*((a-1)/b);


      Any help appreciated.