更改默认滑块JQ UI
Changing the default slider JQ UI
使用JQ UI,我创建了一个标准滑块。我发现了如何更改它的一些参数:大小、最小值、最大值等,但从未找到放照片的地方。即:更改滑块。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Slider - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<style>
#slider-vertical {
height: 600px;
background-color: #0F3;
}
</style>
<script>
$(function () {
$("#slider-vertical").slider({
orientation: "vertical",
range: "min",
min: 0,
max: 100,
value: 60,
slide: function (event, ui) {
$("#amount").val(ui.value);
}
});
});
</script>
</head>
<body>
<div id="slider-vertical"></div>
</body>
</html>
如果您想将绿色区域改为图像,可以将background-color
改为background-image
或仅更改为background
,然后输入所需图像的URL或位置此处演示
#slider-vertical {
height: 600px;
background: url(backgroundImage.jpg);
}
如果你想让它同时在滑块的上方和下方,你可以通过给.ui-slider-range
一个透明的背景来实现,就像一样
.ui-slider-range {
/* If you want the same image as the top part of the slider. */
/* Otherwise you can change the bottom portion here */
background:transparent;
}
此处演示
相关文章:
- 有没有任何方法可以将控制器从文件加载到ui路由器$stateProvider中
- jQuery UI自动完成突然停止工作
- 如何使用skip参数使用angular ui引导进行服务器端分页
- AngularJS UI路由器不能像ng路由器那样工作
- 我可以更改剑道UI网格吗's的外键值
- 剑道UI内联编辑:如何在点击其他按钮时隐藏按钮
- Rails/JSON:如何将JSON用于jquery UI自动完成表单
- 停止jQuery UI滑块移动超过给定值
- 混合 ui-sref 和 $state.go 在 Angular ui-router 中进行状态转换
- Jquery UI自动完成无法工作
- 语义ui如何使用javascript启用或禁用下拉列表
- jquery ui滑块上的滑块值
- jQuery UI可排序-多连接列表拖动
- 如何在Angular UI网格中选择下一行
- 对具有ui typeahead的对象中的值执行orderBy
- AngularJS ui路由器html5模式中断路由
- 使用jQuery迷你图在Angularjs中使用ui-jq进行合成图表
- 更改默认滑块JQ UI
- JQ UI日期选择器-时区
- JQ UI排序表:停止排序表内的一些元素排序