Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9148827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:22:47+00:00 2026-06-17T11:22:47+00:00

I am on a slideshow that users can navigate by clicking the next or

  • 0

I am on a slideshow that users can navigate by clicking the next or pre buttons. At the time of click, I am loading the next or prev image into the img src, as you can see below.

I am trying to maintain compatibility on touch devices as well, and would like to enable swipe to navigate from one photo to the next. My concern with implementing a normal swipe event to handle slideshow navigation, is that it would not have a fluid feel, and when the swipe event would be triggered, there would be a bit of lag and the next image would be loaded, as if the user just clicked the next or prev arrow.

What I am trying to accomplish is that fluid feel that many tablets / smartphones have when traversing through a photo album.

I’d truly appreciate any help accomplishing this,

Many thanks in advance

My JavaScript

    var index=0;

    $('.catalog-img-container').attr("src", img_array[index]);
    $('#dialog').jqm();
    $(".next").click(function(){
        $('.catalog-img-container').attr("src", img_array[++index%arrayLength]);
    });         
    $(".previous").click(function(){
        if (--index < 0) index = arrayLength - 1;
        $('.catalog-img-container').attr("src", img_array[index%arrayLength]);
    });         

My Markup

        <div  class="catalogFrame">
            <img class="catalog-img-container" src="">
        </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:22:48+00:00Added an answer on June 17, 2026 at 11:22 am

    Add a swipeleft and swiperight to your img container:

    $('.catalog-img-container').on('.catalog-img-container', 'swipeleft', function () {
        //next img
        $('.catalog-img-container').attr("src", img_array[++index%arrayLength]);
    }).on('.catalog-img-container', 'swiperight', function () {
        //prev img
        if (--index < 0) index = arrayLength - 1;
        $('.catalog-img-container').attr("src", img_array[index%arrayLength]);
    });
    

    If you want to get more natural feeling change these config options so swipe event can trigger sooner then later:

    $(document).bind("mobileinit", function(){
        $.event.special.swipe.horizontalDistanceThreshold = 30; //(default: 30px) – Swipe horizontal displacement must be more than this.
        $.event.special.swipe.verticalDistanceThreshold = 75; //(default: 75px) – Swipe vertical displacement must be less than this.
    });
    

    More info about this can be found here: http://jquerymobile.com/test/docs/api/events.html

    That is basically that, swipe events are almost fluid on mobile phones (I have a carousel jQuery mobile implementation and it works just fine) so I dont think you are going to have much problems.

    Here’s also my example of swipe events : http://jsfiddle.net/Gajotres/Np3G4/ It is not using jQM swipe implementation but you can test it on Android and iOS platform, it will give you feeling (jQM swipe events work just like that). And here’s jQM implementation: http://jsfiddle.net/Gajotres/qBbsX/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this slideshow that I'm trying to simply move up, but I can't
I've got a slideshow that allows users to annotate slides with a simple drawing
I have an image upload for a slideshow, and the users are continuously uploading
I have a JavaScript slideshow that pre-loads images out of a MySQL database and
I modified a pre-designed slideshow that I found here and I would like to
I have to create a slideshow out of image paths that I store in
I have an element that's going into a slideshow, and when the slide comes
I'm building a slideshow in jQuery that allows the user to see four images,
I have a Flash slideshow that plays SWFs listed in an XML file. I
I have done a simple code for a slideshow that dynamicly loads images from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.