I am building a custom search with custom search form where I have a range slider for number filter. I am able to get the range slider working with jQuery and jQuery UI properly on desktop. However, the range slider do not respond to touch event on mobile. I have added the " jQuery UI touch punch" support on the header file and the corresponding file in appropriate location , but it's still not working.
it should be a simple task but I couldn't figure out where goes wrong. I am wondering if I have done sth wrong or Toolset does not support Mobile touch event on jQuery widget? Please help! thank you so much.
location of the range slider: homepage
views id: 835, name: Search Business View
Header file:
script src="jquery.ui.touch-punch.min.js"></script>
My JS code in View:
// (1) for Price-Slider
jQuery("#price-slider").slider({
range: true,
min: 0,
max: 3000000,
step: 50000,
values: [0, 3000000],
slide: function(event, ui) {
jQuery('input[name="wpv-wpcf-selling-price_min"]').val(ui.values[0]);
jQuery('input[name="wpv-wpcf-selling-price_max"]').val(ui.values[1]);
console.log(ui.values[0]);
console.log(ui.values[1]);
let newTitle = ui.values[0] / 10000 + "萬 : " + ui.values[1] / 10000 + "萬"
// update the tooltip text
jQuery('#price-slider').attr('title', newTitle).tooltip('fixTitle').tooltip('show');
}});
// feed the new value from slider into the hidden toolset text field
jQuery('input[name="wpv-wpcf-selling-price_min"], input[name="wpv-wpcf-selling-price_max"]').change(function() {
jQuery('#price-slider').slider('values', [parseInt($('input[name="wpv-wpcf-selling-price_min"]').val()), parseInt($('input[name="wpv-wpcf-selling-price_max"]').val())]);
});
Thanks for the details, I can log into your website, and checking it in your website, will update here if there is anything found
I have tried the URL you mentioned above in my Android phone, it works fine, see screenshot range-slider.JPG
Is this problem resolved? please let me know if you need more assistance for it. thanks
thank you luo.
Really? but the problem still persists on iphone, both chrome and safari. the range sliders works but it cannot slide, one has to press the range like a button to select number. Any thoughts on what could be the problem?
Thanks for the details, since it is a custom JS codes (range slider) with iPhone device problem, according to our support policy, we don't provide custom support:
https://toolset.com/forums/forum/professional-support/
But I don't have an iPhone device, so I suggest you check it with our Toolset Contractor for it:
https://toolset.com/contractors/
I have searched with google, and found this thread:
https://stackoverflow.com/questions/13808663/jquery-ui-slider-touch-drag-drop-support-on-mobile-devices?answertab=votes#tab-top
And this website:
hidden link
For your reference
Yes as mentioned at the beginning, I have incorporated that JS UI touch punch too but the prob still persists. Nevermind, I will close the ticket. Thank you for your help