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

Re: [ydn-javascript] Slider fixed limits

Expand Messages
  • Eric Miraglia
    Leandro, Your implementation is absolutely possible, but you do need to set up your slider to know about the limits. Let s say, for example, that your slider
    Message 1 of 2 , Sep 2, 2006
    • 0 Attachment
      Leandro,

      Your implementation is absolutely possible, but you do need to set up your slider to know about the limits.

      Let's say, for example, that your slider had a range of 100 and you wanted the thumb to always remain within a 25-75 range therein with a starting value of 50.

      <style>
      #sliderbg {position:relative; width:110px;height:10px;border:1px solid blue;} /* width should be 100px, plus thumb width*/
      #sliderthumb {position:absolute;width:10px;height:10px;background-color:red; }
      </style>

      <div id="sliderbg">
      <div id="sliderthumb"></div>
      </div>

      <script>
      var mySlider = YAHOO.widget.Slider.getHorizSlider(
      "sliderbg",
      "sliderthumb",
      -25, /* thumb can move -25 pixels left from zero-point starting position -- eg, starts at left 25*/
      75  /* thumb can move 75 pixels right from starting position*/
      );
      mySlider.setValue(50, true); // sets starting value

      Regards,
      Eric

      ______________________________________________
      Eric Miraglia
      Yahoo! Presentation Platform Engineering



      On Aug 31, 2006, at 11:25 PM, Leandro Ardissone wrote:

      Hi,

      I'm really new to YUI and want to know if is possible to set limits
      inside the background of the slider.

      Something like:

      |-+----[]--+---|

      where + are the limits, and [] the thumb.

      Then the thumb only can move between the +.

      Thanks


    Your message has been successfully submitted and would be delivered to recipients shortly.