Loading ...
Sorry, an error occurred while loading the content.

Vertical Slider problem

Expand Messages
  • fabi
    I got a strange problem with my slider,when they are vertical (code is 100% ok in horizontal...) The problem is, i can have negative offset with vertical
    Message 1 of 2 , Jul 30, 2007
    • 0 Attachment
      I got a strange problem with my slider,when they are vertical (code is
      100% ok in horizontal...)
      The problem is, i can have negative offset with vertical slider...

      it is a know issue?i did something bad?
    • y_lsmith
      ... Fabi, The offset is calculated by referencing the slider thumb s current x,y position and comparing that to its starting position. offset values increase
      Message 2 of 2 , Oct 31, 2007
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "fabi" <fabien.pigere@...> wrote:
        >
        > I got a strange problem with my slider,when they are vertical (code is
        > 100% ok in horizontal...)
        > The problem is, i can have negative offset with vertical slider...
        >
        > it is a know issue?i did something bad?
        >

        Fabi,

        The offset is calculated by referencing the slider thumb's current x,y
        position and comparing that to its starting position. offset values
        increase from left-to-right and top-to-bottom.

        To have a vertical slider that starts at the bottom, and increases
        value as it moves up, set the slide thumb's initial position

        #slide_thumb {
        position: absolute;
        bottom: 0;
        ...
        }

        and invert the return from getYValue or the offset passed to the
        change event callback.

        slider.subscribe('change',function (offset) {
        offset *= -1; // makes values increase bottom-to-top
        ...
        });

        function myFunc() {
        var offset = -1 * slider.getYValue();
        ...
        }

        Hope this helps,
        Luke
      Your message has been successfully submitted and would be delivered to recipients shortly.