Disable Swipe on slideshow on mobile - Forum | JoomShaper
Staff replied SP Page Builder

Disable Swipe on slideshow on mobile

Asked by Steven Gourlay 1 year ago Last activity 1 year ago

Is it possible to disable the finger scrolling the slideshow, i use the slideshow at the top of website a lot but i find on mobile its a pain as your finger moves the image when your trying to swipe up or down.

1 reply

Atick Eashrak Shuvo Staff

Apologies for the inconvenience. It's possible to disable finger-scrolling for the slideshow. Could you share your website URL so I can assist you better?

Steven Gourlay Asked this
Hi please find link in private section
Atick Eashrak Shuvo Staff

Hello There,

Apologize for the issue you're experiencing. Please add the following JS code to your Template Options -> Custom Code -> Custom JavaScript

jQuery(document).ready(function ($) {

  function isMobile() {
    return /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  }
  setTimeout(function () {
    if (isMobile()) {
      $('.sppb-addon-sp-slider').each(function () {
        var $slider = $(this);
        var instance = $slider.data('jsSlider');

        if (instance) {
          instance.onDragStart = function (e) { };
          instance.onDragMove = function (e) { };
          instance.onDragEnd = function (e) { };
          instance.$outerStage.off('touchstart.jsSlider touchmove.jsSlider touchend.jsSlider touchcancel.jsSlider');
        }
      });
    }
  }, 1000);
});

This should resolve the problem. Please let us know if you need any further assistance!

Best regards

Log in to reply.