YUI thumb slider does not accept variables and expressions

16 views
Skip to first unread message

darkgo

unread,
Nov 21, 2014, 4:21:02 PM11/21/14
to all...@googlegroups.com
I've working on a thumb slider using yui/alloyui. According to the UC, the min and max parameters in the slider should be passed dynamically which means that I cannot hardcode them in the script. Reviewing the specs, it says the slider min, max, value parameters only accept numbers, not expressions. Can anyone help me accomplish this?

This is the jsfiddle: http://jsfiddle.net/bpkscskg/


    mySlider = new Y.Slider({
        //min: 100,                      This works
        //max: 800,                      This works
        //value: 300,                    This works
        min: minValue,                   //Using a variable does not work
        max: maxValue,                   //Using a variable does not work
        value: (maxValue - minValue)/2,  //Using an expression does not work
        majorStep: 50,
        minorStep: 50,
        length: Y.one('#sliderParent').getComputedStyle('width')
    });



Byran Zaugg

unread,
Nov 24, 2014, 2:51:58 PM11/24/14
to all...@googlegroups.com
I'd use valMinAmount rather than minValue. Also run the value through parseInt().

Reply all
Reply to author
Forward
0 new messages