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;
Try this http://touchpunch.furf.com/
I used for a project and it solved the problems i had on ipad and touch devices
Also available in cdnjs
Thanks a lot for the answers. I tried the solution and it was not worked for me at first.Then I realized that I have one more js file that was breaking the functionality. It was jquery progress bar js.I removed it worked perfectly.
As suggested, I used http://touchpunch.furf.com/
and it worked perfectly!
Into the HTML page I used:
JavaScript code that I used to create the Slider Range: