Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript AnythingSlider feature request – swipe support

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #32940
    kuanjian
    Member

    I think it will be great if the swipe support from jQuery Mobile (http://jquerymobile.com/demos/1.0a4.1/docs/api/events.html) can be added to AnythingSlider. It’s like swiping left and right in any mobile devices to navigate the slide forward and backward.

    I was trying add this swipe support to my website so it will be more usable on the ipads but my knowledge in javascript/jquery knowledge is quite poor. I just don’t know where to start.

    #74551
    kuanjian
    Member

    Hi Mottie!
    I have tested it. It works as expected. Thank you so much for your help.

    #83049
    ic7
    Member

    Hi there!

    I’d really like to add the swipe feature!!!
    Unfortunately my js-skills are close to zero…
    So maybe you guys can help me…

    Here’s my edited code from Mottie…


    $(function(){
    $('#slider').anythingSlider(
    { onInitialized: function(e, base)
    { base.$wrapper.bind('swipeleft swiperight', function(e)
    { if (e.type === "swipeleft")
    { base.goBack(); }
    else
    { base.goForward(); }
    }
    );}
    }
    );
    });

    …tried it with a demo-page on the iPad, but it doesn’t work.
    Slider works fine, but the slides are not moving on swipe gesture…

    Thanks for your help in advance!


    @Chris
    : Thank you so much for your great work! Maybe you’ll find the time to add the swipe feature in a future release! It would be an awsome addition to this great slider!

    #83055
    Mottie
    Member

    Hi ic7!

    If you grab the latest version of AnythingSlider (currently v1.7.2), you can set up the swipe as follows (demo):

    $('#slider').anythingSlider({
    clickForwardArrow: "click swiperight",
    clickBackArrow: "click swipeleft"
    });

    But please note, that jQuery Mobile is required before the swipe events will work.

    #87482
    nocss2
    Member

    Does this work on Android with the latest jquery mobile beta 1.0b3? Used the above code and not working on my Xperia Pro.

    #87496
    Mottie
    Member

    Hi Nocss2!

    Try this demo… it doesn’t need jquery mobile at all… maybe it might be a good idea to add it to the plugin core.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.