我想修改库存JQuery UI滑块,以便手柄上有一个箭头而不是正方形.即我想使用自定义图像作为句柄.
有一些教程可以做到:
但我无法让它发挥作用.以下代码生成固定句柄图像:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.slider.js"></script>
<style type="text/css">
#myhandle {position: absolute;z-index: 100;height: 25px;width: 35px;top: auto;background: url(http://stackoverflow.com/content/img/so/vote-arrow-down.png) no-repeat;}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("#slider").slider({handle: '#myhandle'});
});
</script>
</head>
<body>
<div id="slider"><div id="myhandle"></div></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
就好像JQuery没有拿起我想要使用myhandle id作为句柄.我想知道:我是否需要一个JQuery插件来识别句柄选项?(它没有记录在http://docs.jquery.com/UI/Slider中).或许它只能在旧版本的JQuery中运行?
有任何想法吗?