边界设置不正确jQDateRangeSlider [英] Bounds are not being set correctly jQDateRangeSlider

查看:118
本文介绍了边界设置不正确jQDateRangeSlider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQDateRangeSlider作为两个日期之间的滑块.我正在尝试添加两个范围,最小范围是日期不能小于的日期,最大范围是滑块不能大于的日期.在这两个边界之间.但是,我在执行此操作时遇到了麻烦.没有正确显示.这是 jsFiddle

I am using jQDateRangeSlider for a slider between two dates. I am trying to add two bounds, the minimum bound is where the date can't be less than and the maximum bound is the date where the slider can't be more than. The is in between those two bounds. However, I am having trouble implementing this. It's not being shown correctly. Here's a jsFiddle

HTML

  <input id="submit" type="submit" value="submit" />

JS

$("#slider").dateRangeSlider({
  bounds:{
    min: new Date(2011, 05, 31),
    max: new Date(2011, 11, 31)
  }});

推荐答案

我认为您正在寻找的是设置默认值.边界将仅指定滑块的最小值和最大值,但这些值不会显示为选定的值.

I think what you are looking for is to set the default values. The bounds will only specify the min and max values for the slider, but these values won't show up as selected.

defaultValues: {
    min: new Date(2011, 04, 31),
    max: new Date(2011, 11, 31)
  }

如果要选择整个滑块,请将范围和默认值设置为相同的日期.

If you want the entire slider to be selected, set the bounds and default values to the same dates.

这是您更新的 jsFiddle .

这篇关于边界设置不正确jQDateRangeSlider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆