开发者

How to stop JQWicket's AjaxSlider from sliding right?

开发者 https://www.devze.com 2023-02-15 13:29 出处:网络
I\'m a noob to RIA-development and working with the JQWicket\'s Ajax Slider Example. I\'m trying to implement a page of two Ajax sliders and a counter. The idea is that the user can spread the the c

I'm a noob to RIA-development and working with the JQWicket's Ajax Slider Example.

I'm trying to implement a page of two Ajax sliders and a counter. The idea is that the user can spread the the counter value to the sliders, but not exceed the value of the counter. I.e. the slider should stop sliding right when the counter reaches 0.

Example 1: Counter: 100 (%)

Slider Men:      |----------| 0 (%)

Slider Women: |----------| 0 (%)

Example 2: Counter: 0 (%)

Slider Men:      |--x-------| 30 (%) <-- (both of the slider would stop sliding

Slider Women: |------x---| 70开发者_如何学运维 (%) <-- to right at counter = 0)

Now, I dont want to disable the slider, since I want it to slide left still. I just want it stop sliding right. How can I implement the stop-behavior for the sliders? Is it even possible with JQWicket Slider implementation?

All help greatly appreciated and I want to thank you for even reading this far! :)

(if you're a noob like me trying to figure out pretty much the same thing, you might want to check out also my previous questions and the great answers I got about the subject: implementing-javascript-events-to-wicket and working-with-jqwickets-ajaxsliders )


I would check the value of the slider inside the onValueChanged method and (re)set it if the user set a value that is not inside your given range.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号