我想修改库存JQuery UI滑块,以便手柄上有一个箭头而不是一个正方形。即我想使用自定义图像作为句柄。如何更改JQuery UI滑块手柄
有迹象表明,做一些教程:
- http://jqueryfordesigners.com/slider-gallery/
- http://www.ryancoughlin.com/2008/11/04/using-the-jquery-ui-slider/
- http://www.keepthewebweird.com/creating-a-nice-slider-with-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>
这是因为如果JQuery的不捡,我想用myhandle ID为把手。我想知道:我需要一个JQuery插件来识别处理选项吗? (在http://docs.jquery.com/UI/Slider中未记录)。或者,它可能只适用于旧版本的JQuery?
任何想法?
这已被回答之前:http://stackoverflow.com/questions/1170596/changing-slider-handle-image – karim79 2009-07-30 15:24:19
问题中的所有三个教程链接现在已经死了。 :( – 2015-07-23 13:51:01