【问题标题】:jquery ui slider. Help to correct pleasejquery ui 滑块。请帮忙改正
【发布时间】:2011-04-19 04:09:11
【问题描述】:

请帮助解决我的问题。我是 jquery ui 的新手。并尝试创建 jquery 滑块: http://jsfiddle.net/InviS/LYE8B/4/ 但它超出了我的正确位置(参见示例)。如何限制滑块?

【问题讨论】:

  • 你试过改变最大值吗?有关所有选项,请参阅 this
  • 最大值无济于事,因为它根本不控制滑块的外观。
  • 您能在 jQuery 网站上将此作为错误输入吗?

标签: javascript jquery jquery-ui jquery-ui-slider


【解决方案1】:

给你:http://jsfiddle.net/NAC7b/10/

这有点笨拙,但我将滑块包裹在父 <div> 中,并为滑块提供 93% 的最大宽度。这是我更改后的 CSS:

#wrapper{
    width: 100%;
    height: 20px;
    background-color: orange;
    border-top: 1px solid black;
    position: absolute;
    left: 0;
    top: 129px;
}

#scroll{
    width: 93%;
    height: 20px;
    background-color: orange;
    border-top: 1px solid black;
    position: relative;
    left: -1px;
    top: -1px;
}

还有 JavaScript:

$('#scroll').slider({animate: true}).bind('slidestop',function(e,ui){
    //alert(ui.value);
}).wrap('<div id="wrapper" />');

【讨论】:

  • 这比我的代码干净得多;)我很惊讶这在 jQuery UI 中没有实现/修复,因为它现在似乎是一个相当成熟的项目......
猜你喜欢
  • 2011-05-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-12
  • 2012-10-19
  • 2011-11-04
  • 1970-01-01
  • 2013-09-21
相关资源
最近更新 更多