JavaScript Touch Events In Jquery seem devoid of useful information touch events jquery mobile device,touch events jquery,touch events

I am trying to make a web app work on tablets. I don't actually need the guesture stuff from the tablets, just the equivelent of mousedown mouseup and mousemove.

However, the touch events seem to interfere, and don't seem to provide the coordinate data I need.

What I really want is the equivalent of clientX, clientY or similar, but these touch events don't have them, on the iPad for sure. And the mouse events seem to get eaten by the touch events. There also seems to be no other fields in the event data I can leverage.

I don't want to add jq mobile or ui to bulk up the code. It seems

Suggestions?

I wrote this fiddle to capture what the different types of event. It just grabs the event and prints the contents of the event object skipping a bunch of common fields:

http://jsfiddle.net/fraserorr/DBe6A/1/embedded/result/

Code is as follows:

HTML:

<div id='abc'></div>
<div id="log"></div>

CSS:

#abc { width: 200px; height: 200px; background-color: blue;}

JS:

function f(e) {
    for(var i in e) {
        if(i == "isImmediatePropagationStopped") continue;
        if(i == "isPropagationStopped") continue;
        if(i== "stopImmediatePropagation") continue;
        if(i == "stopPropagation") continue;
        if(i == "preventDefault") continue;
        if(i == "handleObj") continue;
        if(i == "data") continue;
        if(i == "delegateTarget") continue;
        if(i == "attrChange") continue;
        if(i == "attrName") continue;
        if(i == "relatedNode") continue;
        if(i == "srcElement") continue;
        if(i == "altKey") continue;
        if(i == "bubbles") continue;
        if(i == "cancelable") continue;
        if(i == "ctrlKey") continue;
        if(i == "currentTarget") continue;
        if(i == "eventPhase") continue;
        if(i == "metaKey") continue;
        if(i == "relatedTarget") continue;
        if(i == "shiftKey") continue;
        if(i == "target") continue;
        if(i == "view") continue;
        if(i == "which") continue;
        if(i == "button") continue;
        if(i == "buttons") continue;
        //if(i == "clientX") continue;
        if(i == "clientY") continue;
        if(i == "fromElement") continue;
        //if(i == "offsetX") continue;
        if(i == "offsetY") continue;
        //if(i == "pageX") continue;
        if(i == "pageY") continue;
        //if(i == "screenX") continue;
        if(i == "screenY") continue;
        if(i == "toElement") continue;
        if(i.substr(0, 6) == "jQuery") continue;
        if(i == "timeStamp") continue;
        if(i == "isDefaultPrevented") continue;
        //if(i == "type") continue;
        if(i == "originalEvent") continue;
        $("#log").prepend(i + ": " + e[i] + "<br/>");
    }    
}    
$(document).ready(function() {
    //$("#abc").on("mousemove", f);
    $("#abc").on("mousedown", f);
    $("#abc").on("touchmove", f);
    $("#abc").on("touchstart", f);
});    
Answer:1

From this post :

touchstart

Action: fires when the screen is touched (will fire for multi-point touches as well)

Equivalent: mousedown

touchend

Action: fires when a finger is lifted from a screen (is really finiky with single point touch).

Equivalent: mouseup

touchmove

Action: fires when one or more fingers move on the screen.

Equivalent: mousemove

To get equivalent of clientX, clientY : Try this fiddle only from touch device.

 touchMe[0].ontouchstart = function(e) {        
    log.html("Touch Start");
    var touche= e.touches[0]; 
    //instead of e.clientX, in touch event we have to acess like this    e.touches[0].clientX.
    log.append("X :" + touche.clientX + "Y :" +touche.clientY);
    log.append("</br>");
}    

Also, this reference may help for you.

Answer:2

I have a component with a login form. What I need to do is to get it to reload the page / route after the user clicks the submit button. The reason for this is that after the submit button is ...

I have a component with a login form. What I need to do is to get it to reload the page / route after the user clicks the submit button. The reason for this is that after the submit button is ...

  1. reload page router angular
  2. reload router page
  3. reload page react router
  4. reload page vue router
  5. reload page react router dom
  6. reload page ui router
  7. reload page using router in angular
  8. angular 4 reload page router

I have a javascript function which returns an boolean in some cases or an Observable in some other cases. Can I somehow always return an Observable by creating Observable out of a boolean?

I have a javascript function which returns an boolean in some cases or an Observable in some other cases. Can I somehow always return an Observable by creating Observable out of a boolean?

  1. convert primitive boolean to string
  2. convert primitive boolean to string java
  3. convert boolean to primitive
  4. convert boolean object to primitive
  5. convert boolean object to primitive java
  6. convert boolean wrapper to primitive in java
  7. java convert boolean to primitive

I'm using ajax file uploader on my pages. https://github.com/blueimp/jQuery-File-Upload I'm using one control for image uploading and another for file uploading and both are on the same page. I've ...

I'm using ajax file uploader on my pages. https://github.com/blueimp/jQuery-File-Upload I'm using one control for image uploading and another for file uploading and both are on the same page. I've ...

  1. disable drag drop javascript
  2. disable drag drop css
  3. disable drag drop windows 10
  4. disable drag drop
  5. disable drag drop angular
  6. disable drag drop sharepoint
  7. disable drag drop textarea
  8. disable drag drop folder windows 7
  9. disable drag drop excel
  10. disable drag drop windows explorer
  11. disable drag drop wpf
  12. disable drag drop in summernote
  13. disable drag drop folder
  14. disable drag drop file
  15. disable drag&drop jquery
  16. prevent drag drop
  17. remove drag drop jquery
  18. disable drag and drop html
  19. disable drag and drop in textbox javascript
  20. disable drag and drop windows 7

Trying to paint each cube face with a different color, I found a thread that presents a way to achieve this: var geometry = new THREE.BoxGeometry(5, 5, 5); for (var i = 0; i < geometry.faces....

Trying to paint each cube face with a different color, I found a thread that presents a way to achieve this: var geometry = new THREE.BoxGeometry(5, 5, 5); for (var i = 0; i < geometry.faces....

  1. cube painted faces