2013-03-16 69 views
3

在范围滑​​块文本框中,我尝试显示5000000,但它只显示500000其余数字可用但不可见我尝试更改大小,但texbox它正在重新排列距离滑块的位置。在jQuery的移动范围滑块需要显示6位数字值

<form> 
    <div data-role="rangeslider"> 
     <label for="minPrice">Price Range &#40;&pound;&#41;</label> 
     <input type="range" name="minPrice" id="minPrice" min="0" max="5000000" value="0"> 
     <label for="maxPrice">Price Range &#40;&pound;&#41;</label> 
     <input type="range" name="maxPrice" id="maxPrice" min="0" max="5000000" value="5000000"> 
    </div> 
</form> 

如何支持价值500万没有slider.So人的重排有想法,这样我可以解决这个issue.I已经提琴手http://jsfiddle.net/8xVWY/100/

回答

1

我给你做工作的例子再生问题:http://jsfiddle.net/Gajotres/8xVWY/110/

解决方案jQuery Mobile的版本1.4 +:http://jsfiddle.net/Gajotres/vJa7Z

HTML:

<form> 
    <div data-role="rangeslider" id="custom-slider"> 
     <label for="minPrice">Price Range &#40;&pound;&#41;</label> 
     <input type="range" name="minPrice" id="minPrice" min="0" max="5000000" value="0"> 
     <label for="maxPrice">Price Range &#40;&pound;&#41;</label> 
     <input type="range" name="maxPrice" id="maxPrice" min="0" max="5000000" value="5000000"> 
    </div> 
</form> 

CSS:

#custom-slider .ui-rangeslider-sliders { 
    margin: 0.5em 100px !important; 
} 

#custom-slider input.ui-input-text.ui-slider-input { 
    width: 70px !important; 
} 
+0

+1 ...运行完美。 – 2013-06-16 08:59:33

+0

@Gajotres:嗨,不幸的是,这个解决方案不适用于jquery mobile 1.4.2。你能不能更新你的jsfiddle?提前致谢。 – kstratis 2014-05-07 10:18:51

+0

我通常不会打电话,但是... :) http://jsfiddle.net/Gajotres/vJa7Z/ – Gajotres 2014-05-07 13:12:10