pinch/pull touchevents in mobile webapp - jquery-plugins

How do I register an pinch or pull event in an mobile webapp.
Is it build in the browser (if so, how can I acces it) or there an jQuery-plugn for this
(using HTML5, jQuery en jQuery mobile)

Check out http://jgestures.codeplex.com/.
(Also, just Google 'jquery gestures')
Related questions:
Catch browser's "zoom" event in JavaScript
javascript event for a mobile pinch/zoom action

Touchy is jQuery plugin that provides support for pinch (in or out), swipe, drag, longpress, and rotate across all browsers that support the touchstart, touchmove and touchend events.

Related

Windows Phone: how to handle an event from a web page in a WebView?

Which callback/delegate is the one to intercept the event of a user clicking on a link within a WebView?
I'd want that URL. I just need to know if it is possible and how should I do in some way.
You can catch events triggered by Javascript code with ScriptNotify event described here.
Not sure what you really want to do but this might be a starting point for you.

How to track a video click inside an iframe using google tag manager?

I want to track a vimeo video inside the following iframe:
<div class="embed-container"><iframe src="//player.vimeo.com/video/108361627?title=0&api=1&portrait=0&badge=0" class="vimeoplayer" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
I understand that I need to push data into the data layer to do this. How can I use the piece of code below to track a click on this iframe? Somewhere outside of the iframe I suppose? Can I give the .embed-container div an extra element with this event in some way?
onClick="_gaq.push(['_trackEvent', 'Video', 'Play', 'intro-video']);"
You'll have to use the Vimeo JavaScript API to listen for player events. When the player events fire, call your GA tracking code.
Vimeo has a library call Froogaloop to help listen for events.
I've found that the vimeo.ga.js library is the best way to wire up GA to Vimeo. It works with Classic Analytics, Universal Analytics and Google Tag Manager.

Jquery Mobile with checkboxes are slow on mobile devices

I have a mobile app where I use Jquery Mobile v. 1.3.1 and PhoneGap.
On a page there're a bunch of checkboxes. When I run the app the list with checkboxes respond very slow when you check/uncheck a checkbox.
What to do?
I used this in Cordova/PhoneGap but I wasn't using jQuery Mobile, just jQuery.
$('input[type="checkbox"]').on( 'touchstart', function(){
$(this).prop("checked", !$(this).prop("checked"));
});
$('input[type="checkbox"]').click(function(event){
event.preventDefault();
event.stopPropagation();
});
You could technically do it by using trigger() and pass custom data to the click event handler, but I couldn't get the parameters to go through for some reason. The above works tho.

Backbone history not filling when using tap event

I'm using backbone for a mobile app dev project (phonegap compiled) but have a problem with the router history. I'm firing the events on tap for extra responsiveness on the mobile platform, however pages visited by triggering tap do not appear to be included in the router's history. When hitting the back button, those are always skipped.
Is there any way to make the backbone router's history work with the tap event?
Thanks for your help
You must call use the navigate method in order to add a page to Backbone history. You can do it programmatically as follows:
var MyApp = new Backbone.Router();
MyApp.navigate('newPage', {trigger: true});
Basically whenever you fire a tap event you can navigate to a particular based on the tap event parameters.

JavaScript framework with, or easily extendable with, support for XmlHttpRequest.onprogress (emulated if necessary)

Which of JavaScript libraries and frameworks has support for "onprogress" event for XmlHttpRequest (perhaps as a plugin or extension), emulated if necessary? Alternatively which JavaScript framework would be easiest to extend to support xhr.onprogress?
By "emulated if necessary" I mean here that if web browser doesn't support XHR 2.0 "onprogress" event, then "onreadystatechange" would be used. Because some browsers fire onreadystatechange only once for each state, and do not call onreadystatechange on server flush, then some kind of timer / interval would probably be necessary to periodically check XHR object if it is such browser.
jQuery and YUI provide only success and error (or equivalent) callback
MooTools provide 'progress' event, but limited to Browsers that support the event. (At this time: Gecko and WebKit).
You may be able to extend jQuery to achieve what you desire with $.ajax Transports. You will have to do all the hard work yourself though.

Resources