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

  • Home
  • SEARCH
  • 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 7829877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:57:06+00:00 2026-06-02T10:57:06+00:00

I am working on a Phonegap App that has dynamically created elements. The app

  • 0

I am working on a Phonegap App that has dynamically created elements. The app can be seen here The Element is created when a user clicks on an accordion menu to reveal a choice of elements. Then the user can choose a new element to add to the layout by click in an image from the menu. The browser alerts that a new element will be inserted in a div that is labelled new element.

Here is the kicker, I am using a jQuery touch plugin to be able to drap the newly created elements on the screen. When the new element is created a class=”touchMove” is added to the element. The issue is that I cannot seem to get the touch function to bind to the new element.

I have tried live(), delegate(), and on(). I can get a click event to bind and display an alert box on click but I cannot get the touch event to bind to the new element. I added the click for testing purposes. If I change it to “touch” I get nothing, perhaps because it is looking for the parameters to be defined for the function. IDK!

$('#newElement').delegate("img","click",function(){
                           // alert('I was clicked');
                            $(this).touch({
                                            animate: false,
                                            sticky: false,
                                            dragx: true,
                                            dragy: true,
                                            rotate: false,
                                            resort: true,
                                            scale: false
                                            });

                            });

Again, if I uncomment the alert function and comment out the touch function the alert works. If I comment out the alert and uncomment the touch function nothing happens.. During this process I see no errors.

There are three elements on the page that receive the touch function just fine on page load with this function

$('.touchMove').touch({
                           animate: false,
                           sticky: false,
                           dragx: true,
                           dragy: true,
                           rotate: false,
                           resort: true,
                           scale: false
                           });

The “#2 Touch Me :)” elements work fine. I am trying to add the class (“touchMove”that is working oK), and use that class to attach the touch function to the new element.

By the way, the touch functions only run on a device (Android, iPad) so if you view it in a actual computer browser the touch events will not work.

Any help with this matter will be appreciated.

  • 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-02T10:57:07+00:00Added an answer on June 2, 2026 at 10:57 am

    Why not use

    //start to touch
    $("body").on("touchstart mousedown","#newElement",function(e){
        alert("you started to touch");
    });
    
    //moving
    $("body").on("touchmove mousemove","#newElement",function(e){
        alert("you moved");
    });
    
    //finished touching
    $("body").on("touchstop mouseup","#newElement",function(e){
        alert("you stopped touching");
    });
    

    You need the to use ‘live’ or ‘on’ as all events are bound when the document loads so any new events bound to an object added to the dom after initial load will either need to be contained within a callback or bound with jquery ‘live’ or ‘on’.

    you could also include the mouse events so functions also work when no touchscreen is available.

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

Sidebar

Related Questions

We've put together an app that is mostly working in phonegap. We have an
I am working on a phonegap app that will be submitted to the itunes
I am working on a PhoneGap app that is supposed to run on iOS
I am working on an android application that uses phonegap/cordova. This app uses a
Has anyone integrated Socialize (getsocialize.com) with PhoneGap? I'm working on a PhoneGap app, and
I'm working with a PhoneGap app that uses Safari local storage (SQlite DB) via
I'm working on a phonegap iPhone app which downloads content from the network in
I'm using ShareKit to post to Facebook from a PhoneGap app which I'm working
I have been working on an Android app using Phonegap and now would like
I am working on an app for android using phonegap and unity. I wrote

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.