ajax 滑块和 Javascript

发布于 2024-11-01 18:05:47 字数 1696 浏览 1 评论 0原文

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

我想知道如何更新 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他夏了夏天 2024-11-08 18:05:47

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

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

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

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

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

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:

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

You GET the value of the slider from the bound text box, the same way you would from any other element. So:

var sliderValue = document.getElementById('<%=Slider1_bound.ClientID%>').value;
  • Pete
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文