2012-12-26 89 views

回答

0

我認爲這裏的例子可以幫助你:

http://jsfiddle.net/cUNyr/1/

$.fn.extend({ 
    sliderLabels: function(left,right) { 
     var $this = $(this); 
     var $sliderdiv= $this.next("div.ui-slider[role='application']"); 
     $sliderdiv 
     .css({'font-weight': 'normal'}); 
     $sliderdiv 
     .prepend('<span class="ui-slider-inner-label" style="position: absolute; left:0px; top:20px;">'+left+ '</span>') 
     .append('<span class="ui-slider-inner-label" style="position: absolute; right:0px; top:20px;">'+right+ '</span>');   
    } 
}); 

$('#slider').sliderLabels('LEFT','RIGHT');​ 
相關問題