ajax 滑块和 Javascript
重写以使事情变得简单并让我理解我需要的...
我想知道如何更新 Ajax 控制工具包最大值以及如何获取其中一个滑块的当前值。这一切都应该在客户端完成。
想法是这样的:
int Used = 0
int max = 325
int Remainder = max - Used
slider1.maximum = Remainder
slider2.maximum = Remainder
slider3.maximum = Remainder
slider1.value = 0
slider2.value = 0
slider3.value = 0
slider1.Setvalue = 150
Used = 150
Remainder = 175
slider1.maximum = Remainder + slider1.value
Becoming 175 + 150
Slider2.maximum = Remainder + slider2.value
Becoming 175 + 0
Slider3.maximum = Remainder + slider3.value
Becoming 175 + 0
slider2.Setvalue = 50
Used = 200
Remainder = 125
slider1.maximum = Remainder + slider1.value
Becoming 125 + 150
Slider2.maximum = Remainder + slider2.value
Becoming 125 + 50
Slider3.maximum = Remainder + slider3.value
Becoming 125 + 0
slider3.Setvalue = 125
Used = 325
Remainder = 0
slider1.maximum = Remainder + slider1.value
Becoming 0 + 150
Slider2.maximum = Remainder + slider2.value
Becoming 0 + 50
Slider3.maximum = Remainder + slider3.value
Becoming 0 + 125
Slider1.Setvalue = 125
Used = 300
Remainder = 25
slider1.maximum = Remainder + slider1.value
Becoming 25 + 125
Slider2.maximum = Remainder + slider2.value
Becoming 25 + 50
Slider3.maximum = Remainder + slider3.value
Becoming 25 + 125
我认为这不会变得更清晰,所以请给我一些反馈。非常感谢!
一旦用户对设置感到满意,就应该通过按钮将其发送回服务器。
Rewriten to make things simple and give me the understanding I need...
I want to know how to update the Ajax Control Toolkits Maximum value and how to get the current value of one of the sliders. this all should be done on the client-side.
The Idea is like this:
int Used = 0
int max = 325
int Remainder = max - Used
slider1.maximum = Remainder
slider2.maximum = Remainder
slider3.maximum = Remainder
slider1.value = 0
slider2.value = 0
slider3.value = 0
slider1.Setvalue = 150
Used = 150
Remainder = 175
slider1.maximum = Remainder + slider1.value
Becoming 175 + 150
Slider2.maximum = Remainder + slider2.value
Becoming 175 + 0
Slider3.maximum = Remainder + slider3.value
Becoming 175 + 0
slider2.Setvalue = 50
Used = 200
Remainder = 125
slider1.maximum = Remainder + slider1.value
Becoming 125 + 150
Slider2.maximum = Remainder + slider2.value
Becoming 125 + 50
Slider3.maximum = Remainder + slider3.value
Becoming 125 + 0
slider3.Setvalue = 125
Used = 325
Remainder = 0
slider1.maximum = Remainder + slider1.value
Becoming 0 + 150
Slider2.maximum = Remainder + slider2.value
Becoming 0 + 50
Slider3.maximum = Remainder + slider3.value
Becoming 0 + 125
Slider1.Setvalue = 125
Used = 300
Remainder = 25
slider1.maximum = Remainder + slider1.value
Becoming 25 + 125
Slider2.maximum = Remainder + slider2.value
Becoming 25 + 50
Slider3.maximum = Remainder + slider3.value
Becoming 25 + 125
I don't think this can become any clearer, so please give me some feed back. much appreciated!
And once the user is happy with the setup it should be send back to the server with a button..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这是一个老问题,但由于没有人回答,而且这是我查看的第一页(谷歌搜索同一问题),我想我应该放弃在这里找到的答案。也许它会缩短其他人的搜索时间。
假设您要扩展的文本框名为 Slider1。您可以使用 $find() 设置滑块的值和最大值。即:
您可以从绑定文本框中获取滑块的值,就像从任何其他元素获取滑块的值一样。所以:
I know this is an old question, but since no one answered and this is the first page I looked at (googling this same question), I thought I'd drop the answer I found here. Maybe it'll shorten someone else's search.
Let's assume that the textbox you're extending is named Slider1. You set the value of the slider, and the Maximum value using $find(). Ie:
You GET the value of the slider from the bound text box, the same way you would from any other element. So: