How to detect if user clicked with mouse or touched an item in createJS

349
December 11, 2016, at 00:07 AM

I'm making a game using HTML5/createJS, the thing is that I must know if the user clicked on a item or used touch to tap on it because the time to answer matters.

The code is here, I enabled the touch in createJS then the click function works for both clicking and tap.

createjs.Touch.enable(stage);
item.addEventListener("click", startCounter);
startCounter = function(evt)
{
  console.log(evt.isTouch)
  //IF CLICK { }
  //IF TAP { }
}

evt.isTouch gives me always false on my touchscreen laptop if I use the mouse or tap on the screen.

Rent Charter Buses Company
READ ALSO
Bootstrap modal open button requires two clicks to reopen after closing

Bootstrap modal open button requires two clicks to reopen after closing

I'm firing a modal via a button with data attributesThe button sits in a row on a datatable

487
chrome.webRequest.onBeforeRequest.addListener Cannot read property 'onBeforeRequest' of undefined

chrome.webRequest.onBeforeRequest.addListener Cannot read property 'onBeforeRequest' of undefined

I'm trying to build my own chrome extension and I'm trying to add an event handler using onBeforeRequest

936
stopPropagation in a button submit when an input text is null

stopPropagation in a button submit when an input text is null

I need to know how can I stopPropagation of a button submit when the input text "criteria" is null or empty using jquery

408
Updating Bootstrap Modal Via Ajax - why doesn't modal('show') need calling here?

Updating Bootstrap Modal Via Ajax - why doesn't modal('show') need calling here?

This code (from a wordpress plugin I'm developing) appears to work - opening a modal, making an ajax call, retrieving some data and displaying it in the modal, using Bootstrap 3 and (native WP) jQuery 111

326