gpt4 book ai didi

c# - ajax slider 和 Javascript

转载 作者:行者123 更新时间:2023-11-28 10:20:59 27 4
gpt4 key购买 nike

重写以使事情变得简单并让我理解我需要的......

我想知道如何更新 Ajax 控件工具包最大值以及如何获取其中一个 slider 的当前值。这一切都应该在客户端完成。

想法是这样的:

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

我认为这不会变得更清楚,所以请给我一些反馈。非常感谢!

一旦用户对设置感到满意,就应该通过按钮将其发送回服务器..

最佳答案

我知道这是一个老问题,但由于没有人回答,而且这是我查看的第一页(谷歌搜索同一问题),我想我应该放弃在这里找到的答案。也许它会缩短其他人的搜索时间。

假设您要扩展的文本框名为 Slider1。您可以使用 $find() 设置 slider 的值和最大值。即:

$find("Slider1").set_Maximum(100);
$find("Slider1").set_Value(500);

您可以从绑定(bind)文本框中获取 slider 的值,就像从任何其他元素获取 slider 的值一样。所以:

var sliderValue = document.getElementById('<%=Slider1_bound.ClientID%>').value;
  • 皮特

关于c# - ajax slider 和 Javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5686351/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com