<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Remove onClick delay on webkit for iPhone</title>
	<atom:link href="http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/feed" rel="self" type="application/rss+xml" />
	<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone</link>
	<description>Web and mobile development</description>
	<lastBuildDate>Sat, 04 Feb 2012 01:15:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Max</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-25773</link>
		<dc:creator>Max</dc:creator>
		<pubDate>Tue, 31 Jan 2012 11:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-25773</guid>
		<description>I solved it a little bit differently with Zepto https://github.com/suprMax/Zepto-onTouch/blob/master/zepto.onpress.js</description>
		<content:encoded><![CDATA[<p>I solved it a little bit differently with Zepto <a href="https://github.com/suprMax/Zepto-onTouch/blob/master/zepto.onpress.js" rel="nofollow">https://github.com/suprMax/Zepto-onTouch/blob/master/zepto.onpress.js</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kai</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-25619</link>
		<dc:creator>Kai</dc:creator>
		<pubDate>Sat, 31 Dec 2011 07:15:06 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-25619</guid>
		<description>Matteo, this is great work as usual. With the update from 2009/02/27 that includes the &quot;pressed&quot; state class, does the class get added automatically or do I need to do anything else in addition to &quot;new NoClickDelay(document.getElementById(&#039;element&#039;));&quot;?</description>
		<content:encoded><![CDATA[<p>Matteo, this is great work as usual. With the update from 2009/02/27 that includes the &#8220;pressed&#8221; state class, does the class get added automatically or do I need to do anything else in addition to &#8220;new NoClickDelay(document.getElementById(&#8216;element&#8217;));&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bartebuss &#8211; the beginning : runemartin.com/blog</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-24557</link>
		<dc:creator>Bartebuss &#8211; the beginning : runemartin.com/blog</dc:creator>
		<pubDate>Tue, 13 Sep 2011 07:16:55 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-24557</guid>
		<description>[...] finnes forskjellige script som mener å løse problemet, men de fleste har mangler. Ulempen er at det i browsere på enheter [...]</description>
		<content:encoded><![CDATA[<p>[...] finnes forskjellige script som mener å løse problemet, men de fleste har mangler. Ulempen er at det i browsere på enheter [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felix</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-24423</link>
		<dc:creator>Felix</dc:creator>
		<pubDate>Mon, 22 Aug 2011 10:43:55 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-24423</guid>
		<description>I experienced the two-click problem as well. It only happens occasionally, and it may depend on how long one holds the button.</description>
		<content:encoded><![CDATA[<p>I experienced the two-click problem as well. It only happens occasionally, and it may depend on how long one holds the button.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: IOS App Created Wholly with HTML 5 &#8211; Input lag… fixable? - Programmers Goodies</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-24409</link>
		<dc:creator>IOS App Created Wholly with HTML 5 &#8211; Input lag… fixable? - Programmers Goodies</dc:creator>
		<pubDate>Sat, 20 Aug 2011 09:43:42 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-24409</guid>
		<description>[...] A possible solution using touchStart/touchMove/touchEnd events is detailed here [...]</description>
		<content:encoded><![CDATA[<p>[...] A possible solution using touchStart/touchMove/touchEnd events is detailed here [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How do you make UIWebView behave like a native app? - Quora</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-24276</link>
		<dc:creator>How do you make UIWebView behave like a native app? - Quora</dc:creator>
		<pubDate>Fri, 29 Jul 2011 15:46:59 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-24276</guid>
		<description>[...] to respond immediately when touched, you can use this technique to make it behave how you want. http://cubiq.org/remove-onclick-...When designing the content inside of the web view, try to &quot;think touch.&quot; Tiny links may [...]</description>
		<content:encoded><![CDATA[<p>[...] to respond immediately when touched, you can use this technique to make it behave how you want. <a href="http://cubiq.org/remove-onclick-...When" rel="nofollow">http://cubiq.org/remove-onclick-&#8230;When</a> designing the content inside of the web view, try to &quot;think touch.&quot; Tiny links may [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-24073</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 06 Jul 2011 20:17:43 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-24073</guid>
		<description>oh... it broke my HTML.. .I meant &lt;select&gt; tags...</description>
		<content:encoded><![CDATA[<p>oh&#8230; it broke my HTML.. .I meant &lt;select&gt; tags&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-24071</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 06 Jul 2011 18:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-24071</guid>
		<description>Has anyone had problems with this working on  tags?

I am using it on a table full of various elements and it seems to render my tags unusable.

:(</description>
		<content:encoded><![CDATA[<p>Has anyone had problems with this working on  tags?</p>
<p>I am using it on a table full of various elements and it seems to render my tags unusable.</p>
<p> <img src='http://cubiq.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alp</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-24036</link>
		<dc:creator>Alp</dc:creator>
		<pubDate>Wed, 29 Jun 2011 22:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-24036</guid>
		<description>Is it possible to replace all &quot;onclick&quot; keywords inside the HTML and other loaded scripts&#039; with the &quot;onTouchEnd&quot; before the DOM content is not loaded; (if the browser supports onTouchEnd functionality) ?

I think it would be more simple and generic solution.</description>
		<content:encoded><![CDATA[<p>Is it possible to replace all &#8220;onclick&#8221; keywords inside the HTML and other loaded scripts&#8217; with the &#8220;onTouchEnd&#8221; before the DOM content is not loaded; (if the browser supports onTouchEnd functionality) ?</p>
<p>I think it would be more simple and generic solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/comment-page-1#comment-23953</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Sat, 18 Jun 2011 03:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://cubiq.org/?p=9#comment-23953</guid>
		<description>Great script.

A slight modification would allow for some wiggle room if the movement occurs inside the boundaries of the &quot;button&quot; (the element that has the onClick event attached to it).

function NoClickDelay(el) {
	this.element = typeof el == &#039;object&#039; ? el : document.getElementById(el);
	if( window.Touch ) this.element.addEventListener(&#039;touchstart&#039;, this, false);
}

NoClickDelay.prototype = {

	handleEvent: function(e) {
		switch(e.type) {
			case &#039;touchstart&#039;: this.onTouchStart(e); break;
			case &#039;touchmove&#039;: this.onTouchMove(e); break;
			case &#039;touchend&#039;: this.onTouchEnd(e); break;
		}
	},

	onTouchStart: function(e) {
		e.preventDefault();
		//e.stopPropagation();

		//this.moved = false;

		this.theTarget = document.elementFromPoint(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
		if(this.theTarget.nodeType == 3) this.theTarget = theTarget.parentNode;
		this.checkTarget = this.theTarget;

		this.theTarget.className+= &#039; pressed&#039;;

		this.element.addEventListener(&#039;touchmove&#039;, this, false);
		this.element.addEventListener(&#039;touchend&#039;, this, false);
	},

	onTouchMove: function(e) {
		//this.moved = true;
		this.checkTarget = document.elementFromPoint(e.targetTouches[0].clientX, e.targetTouches[0].clientY);
		if(this.checkTarget.nodeType == 3) this.checkTarget = this.checkTarget.parentNode;
	},

	onTouchEnd: function(e) {
		this.element.removeEventListener(&#039;touchmove&#039;, this, false);
		this.element.removeEventListener(&#039;touchend&#039;, this, false);

		if(this.checkTarget == this.theTarget ) {
		//if( !this.moved &amp;&amp; this.theTarget ) {
			this.theTarget.className = this.theTarget.className.replace(/ ?pressed/gi, &#039;&#039;);
			var theEvent = document.createEvent(&#039;MouseEvents&#039;);
			theEvent.initEvent(&#039;click&#039;, true, true);
			this.theTarget.dispatchEvent(theEvent);
		}

		this.theTarget = undefined;
	}
};</description>
		<content:encoded><![CDATA[<p>Great script.</p>
<p>A slight modification would allow for some wiggle room if the movement occurs inside the boundaries of the &#8220;button&#8221; (the element that has the onClick event attached to it).</p>
<p>function NoClickDelay(el) {<br />
	this.element = typeof el == &#8216;object&#8217; ? el : document.getElementById(el);<br />
	if( window.Touch ) this.element.addEventListener(&#8216;touchstart&#8217;, this, false);<br />
}</p>
<p>NoClickDelay.prototype = {</p>
<p>	handleEvent: function(e) {<br />
		switch(e.type) {<br />
			case &#8216;touchstart&#8217;: this.onTouchStart(e); break;<br />
			case &#8216;touchmove&#8217;: this.onTouchMove(e); break;<br />
			case &#8216;touchend&#8217;: this.onTouchEnd(e); break;<br />
		}<br />
	},</p>
<p>	onTouchStart: function(e) {<br />
		e.preventDefault();<br />
		//e.stopPropagation();</p>
<p>		//this.moved = false;</p>
<p>		this.theTarget = document.elementFromPoint(e.targetTouches[0].clientX, e.targetTouches[0].clientY);<br />
		if(this.theTarget.nodeType == 3) this.theTarget = theTarget.parentNode;<br />
		this.checkTarget = this.theTarget;</p>
<p>		this.theTarget.className+= &#8216; pressed&#8217;;</p>
<p>		this.element.addEventListener(&#8216;touchmove&#8217;, this, false);<br />
		this.element.addEventListener(&#8216;touchend&#8217;, this, false);<br />
	},</p>
<p>	onTouchMove: function(e) {<br />
		//this.moved = true;<br />
		this.checkTarget = document.elementFromPoint(e.targetTouches[0].clientX, e.targetTouches[0].clientY);<br />
		if(this.checkTarget.nodeType == 3) this.checkTarget = this.checkTarget.parentNode;<br />
	},</p>
<p>	onTouchEnd: function(e) {<br />
		this.element.removeEventListener(&#8216;touchmove&#8217;, this, false);<br />
		this.element.removeEventListener(&#8216;touchend&#8217;, this, false);</p>
<p>		if(this.checkTarget == this.theTarget ) {<br />
		//if( !this.moved &amp;&amp; this.theTarget ) {<br />
			this.theTarget.className = this.theTarget.className.replace(/ ?pressed/gi, &#8221;);<br />
			var theEvent = document.createEvent(&#8216;MouseEvents&#8217;);<br />
			theEvent.initEvent(&#8216;click&#8217;, true, true);<br />
			this.theTarget.dispatchEvent(theEvent);<br />
		}</p>
<p>		this.theTarget = undefined;<br />
	}<br />
};</p>
]]></content:encoded>
	</item>
</channel>
</rss>

