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 8784679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:09:30+00:00 2026-06-13T21:09:30+00:00

I have elements on a page that are loaded dynamically, but I also need

  • 0

I have elements on a page that are loaded dynamically, but I also need to be able to swipe on these divs.

I searched for jQuery swipe events, and found touchSwipe. This is nice because it’s cross browser, but it does not allow me to use .on() or .live(), so the dynamic elements aren’t accounted for.

Here’s an example of what I mean, http://jsfiddle.net/wUkZq/

The only way I could get swiping to work on the dynamic elements was to attach the swipe event to the parent. Problem is, I don’t want the parent to be swipeable. In the example, if you create a few elements with the a link, then try and swipe within .content, it will return the text of all elements, which is not what I’m wanting, as swiping should not be allowed in the parent.

Is there a better way to do this, or a better plugin? Ideally, I’d like to not use a plugin, but pure JS, but I can’t find a good example of calculating when the person is actually swiping instead of some other event (i.e. scrolling).

  • 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-13T21:09:32+00:00Added an answer on June 13, 2026 at 9:09 pm

    How about simply assigning each swipeable element a specific class, then checking for that class in the swipe event handler? It’s quite a common trick for such cases, I suppose. For example:

    swipeLeft: function(event, direction, distance, duration, fingerCount) {
      var $target = $(event.target);  
      if (! $target.hasClass('sw')) {
        return false;
      }
      alert($target.text());
    }
    

    Here’s a JS Fiddle illustrating the concept.

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

Sidebar

Related Questions

I have TRs that are added dynamically after the page is loaded. When they
I have a page that allows users to dynamically change the loaded theme (stylesheet).
I have an app with a calendar page. On that page I have elements
On my site: http://alsite.com.br/solalev/ I have some elements on the bottom of page that
I have a page that displays a list with a of elements with a
I have n number of select elements in an html page that are used
I have a form that when submitted successfully generates new elements on the page
I have a number of elements on a web page, that are scattered, meaning
Using the jquery metadata plugin, I have an element on my page that looks
I have multiple ajax forms on page that cointain same elemets, I have jquery

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.