1
A
回答
4
要设置jQuery滑块的宽度,只需使用CSS将其包装为div和样式即可。你也可以通过CSS引用子元素来设置它们的风格,但是这必须在jQuery渲染后使用jQuery完成。
例子:
<script type="text/javascript">
$(document).ready(function(){
//render the sliders
$(".oSlider").slider({
value: 12,
min: 8,
max: 24,
step: 1
});
//size each handle according to class
$(".narrow-handle .ui-slider-handle").css("width","10px");
$(".wide-handle .ui-slider-handle").css("width","50px");
});
</script>
<style type="text/css">
/* define a width for the sliders by styling the wrapping div */
.oSliderContainer { width:100px; }
.oSliderContainer2 { width:200px; }
</style>
<div class="oSliderContainer"><div class="oSlider narrow-handle"></div></div>
<div class="oSliderContainer2"><div class="oSlider wide-handle"></div></div>
我希望回答您的问题,祝你好运!
1
你试过Lemmon Slider吗?
http://jquery.lemmonjuice.com/plugins/slider-variable-widths.php
相关问题
- 1. jQuery可变宽度滑块
- 2. jQuery查找块元素的宽度
- 3. 改变元素的宽度?
- 4. 滑块元素不会超过容器宽度的100%
- 5. 清除可变宽度父元素中的子元素的行
- 6. Jquery UI更改滑块手柄宽度?
- 7. jQuery元素宽度类型
- 8. 宽度小于页宽的离子滑块离子滑块盒
- 9. 力空块元素的宽度
- 10. 宽度轨道滑块
- 11. 流体宽度滑块
- 12. 滑块宽度问题
- 13. 自定义全宽度滑动滑块
- 14. HTML滑块元素?
- 15. 以最小宽度“变为块”的流体元素
- 16. WPF:如何在元素宽度发生变化时动画元素的宽度
- 17. 在jQuery中的CSS3元素宽度
- 18. 在块元素中限制边框宽度为文本宽度
- 19. 由jQuery设置的填充改变元素的宽度
- 20. jQuery动画元素的中心宽度变化不定
- 21. CSS - Firefox中滑块的宽度
- 22. 增加Qualtrics滑块值框的宽度
- 23. 基于文档宽度的div滑块
- 24. 限制div滑块的宽度
- 25. 滚动时元素宽度变化
- 26. 块元素,水平居中对齐和最小宽度可能
- 27. Jquery Mobile-页脚元素,100%宽度
- 28. 我可以使面板宽度是尾部滑块内图像的宽度吗?
- 29. 用鼠标悬停jQuery元素更改元素的宽度
- 30. jQuery。元素宽度取决于其父宽度