Jquery 滑块范围在 iPad 上不起作用 [英] Jquery slider range doesn't work on iPad
本文介绍了Jquery 滑块范围在 iPad 上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面是我的 Jquery 滑块范围(最小-最大)代码,拖动在台式计算机上工作正常,但是当我在 iPad 上测试时,它不起作用.谁能帮我解决这个问题?
below is my Jquery slider range (min-max) code, the drag works fine on desktop computer, but when I test this on iPad, it doesn't work. Can anyone help me with this please?
很遗憾,我无法附上图片.下面是滑块范围示意图,
Unfortunately I can't attach image. Below is the diagram of slider range,
=====(>)=======(<)=====
=====(>)=======(<)=====
var maxValue,myRequest,isDown=false,setUrl;
setUrl = "/search_type/filter.php";
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
step:25,
orientation: "horizontal",
values: [ 0,500 ],
slide: function( event, ui ) {
if(ui.values[1] === 500)
{
maxValue = 500+"+";
}
else
{
maxValue = ui.values[1];
}
$( "#priceRange" ).val( "£" + ui.values[ 0 ] + " to £" + maxValue );
}
});
// AJAX CALL
$("#slider-range").find('a').mousedown(function(){
isDown=true;
});
$(document).mouseup(function(){
if(isDown)
{
return setAjaxRequest();
}
});
// Decoration drag image
$( "#slider-range" )
.find('.ui-slider-handle')
.eq(0).addClass('a-right').end()
.eq(1).addClass('a-left');
//Default this is
$( "#priceRange" )
.val( "£" + $( "#slider-range" )
.slider( "values", 0 ) + " to £" + $( "#slider-range" )
.slider( "values", 1 )+'+');
return true;
推荐答案
试试这个 http://touchpunch.furf.com/
我用于一个项目,它解决了我在 ipad 和触摸设备上遇到的问题
I used for a project and it solved the problems i had on ipad and touch devices
也可在 cdnjs
这篇关于Jquery 滑块范围在 iPad 上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文