Slider on Mobile

purewater1
3 Posts
purewater1 posted this 04 June 2020
Ask a Question

Hello,

I am creating a website that includes a slideshow. I noticed, that the slides can not be moved by swiping the individual slides on mobile devices. There are no settings, that I can use to activate the swipe function.

How can I make this work?

Thanks for your help.

Heinrich

Vote to pay developers attention to this features or issue.
6 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 04 June 2020

Hi Heinrich,

Unfortunately, the touch-swipe function is not supported.

...................................................
Sincerely,
Olivia
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

wiz.real
1 Posts
wiz.real posted this 03 November 2020

swipe all carousels left-right:

document.addEventListener('touchstart', handleTouchStart, false);
document.addEventListener('touchmove', handleTouchMove, false);

var xDown = null;
var yDown = null;

function getTouches(evt) {
return evt.touches || evt.originalEvent.touches;
}

function handleTouchStart(evt) {

const firstTouch = getTouches(evt)[0];
xDown = firstTouch.clientX;
yDown = firstTouch.clientY;

};

function handleTouchMove(evt) {

if ( ! xDown || ! yDown ) {
    return;
}

var xUp = evt.touches[0].clientX;
var yUp = evt.touches[0].clientY;

var xDiff = xDown - xUp;
var yDiff = yDown - yUp;

if ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {
    if ( xDiff > 0 ) {
        $(".u-carousel .u-carousel-control-next").click();
    } else {
        $(".u-carousel .u-carousel-control-prev").click();
    }
} else {
    if ( yDiff > 0 ) {
        /* up swipe */ 
    } else { 
        /* down swipe */
    }
}
/* reset values */
xDown = null;
yDown = null;

};

desty.oosa
2 Posts
desty.oosa posted this 16 March 2021

swipe all carousels left-right:

document.addEventListener('touchstart', handleTouchStart, false);
document.addEventListener('touchmove', handleTouchMove, false);

var xDown = null;
var yDown = null;

function getTouches(evt) {
return evt.touches || evt.originalEvent.touches;
}

function handleTouchStart(evt) {

const firstTouch = getTouches(evt)[0];
xDown = firstTouch.clientX;
yDown = firstTouch.clientY;

};

function handleTouchMove(evt) {

if ( ! xDown || ! yDown ) {
    return;
}

var xUp = evt.touches[0].clientX;
var yUp = evt.touches[0].clientY;

var xDiff = xDown - xUp;
var yDiff = yDown - yUp;

if ( Math.abs( xDiff ) > Math.abs( yDiff ) ) {
    if ( xDiff > 0 ) {
        $(".u-carousel .u-carousel-control-next").click();
    } else {
        $(".u-carousel .u-carousel-control-prev").click();
    }
} else {
    if ( yDiff > 0 ) {
        /* up swipe */ 
    } else { 
        /* down swipe */
    }
}
/* reset values */
xDown = null;
yDown = null;

};

это добавить как общий скрипт у меня просто не получилось.

Support Team
Support Team posted this 16 March 2021

Hi,

With Nicepage 3.9 version https://nicepage.com/doc/143490/mobile-slide-swiping-and-slider-arrows, we have supported slide swiping for mobile device users with touch screens. The swiping now works automatically on all sliding Elements, including Slider, Image Slider, Product Image Slider, and Full-Width Slider.

...................................................
Sincerely,
Susanna I.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

fmeruane
1 Posts
fmeruane posted this 28 July 2021

Hi, i´m using a slider in my web design but for some reason I can´t swipe the first image in my mobile... it works only after I have used the arrows to change the first image... any reason why is that? am i missing something? Thanks for your help!!!

Support Team
Support Team posted this 29 July 2021

Hi,

Please provide a link to your site where we could see the issue.

...................................................
Sincerely,
Hella
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

You must log in or register to leave comments