Swipe objects?

kineouk Community Member Posts: 28
I'm finalising some responsive templates at the moment and all is going hunky dory.

Maybe I'm missing it, but is there a way to swipe an object or a button on a page, to trigger an action? I've got a series of images with text, that I use a next and back button to scroll through (basic 'showing' and 'hiding' as these are clicked - nothing fancy).

I've been asked if it's possible to swipe the images themselves to scroll through them. Any help / suggestions / answers with this would be lovely and gratefully received.




  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    The Swipe Right and Swipe Left actions are standard actions that can be attached to a page (e.g. On Swipe Right - do this or that). You cannot attach it to a specific object on a page. But you can do something like "Page - On Swipe Left - Hide image 1, show image 2" + "Page - On Swipe Right - Hide image 2, Show image 1" to add illusion of swiping.

    P.S. "hunky dory"? :D
  • klaatu
    klaatu Community Member Posts: 988
    In addition to the built in functionality Sergey pointed out above if you know a little JavaScript it isn't too difficult to add a lightbox, such as Magnific.
  • kineouk
    kineouk Community Member Posts: 28
    Cheers Sergey. I thought as much.

    It's a shame it can't be done on objects. Maybe is a nice to have in the future, since we're creating mobile and tablet experiences nowadays.

    I put this in on page level, as you suggested, but it doesn't really work for me. Ah well - I'll just say it can't be done for now. Not a biggie. Thanks again.
  • klaatu
    klaatu Community Member Posts: 988
    Swipe the cat see the car.

    You can add your own copy of Hammer.js if you want to swipe on individual objects. Trivantis already employs Hammer.js when you build a responsive title, however, I have not had the time to examine their embedded code to tap into it. So far adding my own via html Extension has not yielded negative results. It is possible to have conflicts when adding one on top of the one already there but so far so good.

    It should be relatively easy for Trivantis to add this functionality to all objects since they are already using and familiar with Hammer.js code.

    I still think what you are looking to do is add a lightbox to your project so you can swipe to view individual images. Carousels are another option but  are usually for viewing more than one image at a time although you can usually set them up as lightboxes too (Magnific allows this).
  • kineouk
    kineouk Community Member Posts: 28
    Thanks very much Darrel. I'll give it a whirl on my next project or in some downtime, to try it out. Appreciate your help on it.