jquery ui 滑块范围以适应预定值(座位总数)
我正在制作一个在火车上预订座位的应用程序,但我需要区分儿童和成人,所以我解决了两个 jquery-ui 滑块(每个滑块都绑定到一个表单元素),问题在于: 椅子总数为 56 个,因此两个滑块的最小值:1,最大值:56 开始,但如果客户选择 56 个成人和 56 个儿童,则火车容量将无法满足该需求(我愚蠢地允许) ,所以我认为我可以在移动滑块时减去 max: 值,但我不能(我显示的代码比我正在使用的代码更干净,以尝试完成减去)
你可以检查我到目前为止得到的代码: http://jsbin.com/ezeqav/7
PD:提前谢谢:D
(这些不是问题,但是,为了让您了解更多背景信息,我(在此处的帮助下;D)构建了一个计算器,以在客户设置时向其显示总成本移动人数 滑块。)
I'm making an application to reserve seats on a train, but i need to discriminate between children and grown-ups, so i have settled two jquery-ui sliders (each one bound to a form element) the problem is here:
the total number of chairs is 56 so both sliders have min: 1, max: 56 to start, but if the costumer selects 56 grown-ups and 56 childrens the train capacity won't suffice that demand (that I'm stupidly allowing), so I think i could just subtract the max: value, as I move the slider, but i couldn't (the code I'm showing is a bit cleaner that the one that i was using, to try to accomplish the subtract)
you can check the code I got so far here : http://jsbin.com/ezeqav/7
PD: thx in advance :D
(these is not the problem but, to put you a lil bit more in context, i have (with help from here ;D) built a calculator to show the costumer a total cost while he is setting the qtty of people by moving slider.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论