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

Changing Slider limits in Code

Expand Messages
  • Ron
    I have 2 sliders on a page. The values for Slider #1 remain constant. The values and image for Slider #2 change based upon the selected value of Slider #1. I
    Message 1 of 2 , Aug 20, 2007
    • 0 Attachment
      I have 2 sliders on a page. The values for Slider #1 remain constant.
      The values and image for Slider #2 change based upon the selected
      value of Slider #1. I am able to swap the slider background image
      dynamically for Slider #2, but can't see how to dynamically set the
      limits of slider #2. Is there a way to do this in code? I've tried
      using the setXConstraint/setYConstrain methods, but that doesn't seem
      to work. Basically, i need to set these limits in code on the fly...
    • y_lsmith
      ... Ron, You may have been trying to setXConstraint on the slider itself. Try var slider = YAHOO.widget.Slider.getHorizSlider( bar , thumb ,0,200); // Allow
      Message 2 of 2 , Oct 31, 2007
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "Ron" <rlf2004@...> wrote:
        >
        > I have 2 sliders on a page. The values for Slider #1 remain constant.
        > The values and image for Slider #2 change based upon the selected
        > value of Slider #1. I am able to swap the slider background image
        > dynamically for Slider #2, but can't see how to dynamically set the
        > limits of slider #2. Is there a way to do this in code? I've tried
        > using the setXConstraint/setYConstrain methods, but that doesn't seem
        > to work. Basically, i need to set these limits in code on the fly...
        >

        Ron,

        You may have been trying to setXConstraint on the slider itself. Try

        var slider = YAHOO.widget.Slider.getHorizSlider('bar','thumb',0,200);

        // Allow the Slider thumb to move 500px to the right
        slider.thumb.setXConstraint(0,500);

        Note the setXConstraint is called on the thumb.

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