<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-21713417</id><updated>2011-12-13T21:59:25.657-06:00</updated><title type='text'>Red Javascript Diaries</title><subtitle type='html'>The Erotic Side of JavaScript. 
AJAX, Prototype, Rico and more fancy effects. También se habla español</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javascriptdiaries.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21713417/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://javascriptdiaries.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Daniel Guerrero</name><uri>http://www.blogger.com/profile/05241701013236428539</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_VLsxbNGyq_o/SaXyy_eH3DI/AAAAAAAAAAY/twMklEtAHig/S220/danguer_medium.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-21713417.post-113907847775718920</id><published>2006-02-04T12:38:00.000-06:00</published><updated>2006-02-04T12:41:17.766-06:00</updated><title type='text'>Marquee - Beta</title><content type='html'>This is only an announce, here will be the content of the article, the code is on:&lt;br /&gt;&lt;a href="http://www.danguer.com/articles/diaries/javascript/marquee/"&gt;http://www.danguer.com/articles/diaries/javascript/marquee/&lt;/a&gt;&lt;br /&gt;And simulates a marquee similar to the one on blogger, it has a bug on safari, that's why it's beta.&lt;br /&gt;Comments about the code working/non working are welcome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21713417-113907847775718920?l=javascriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptdiaries.blogspot.com/feeds/113907847775718920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21713417&amp;postID=113907847775718920' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21713417/posts/default/113907847775718920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21713417/posts/default/113907847775718920'/><link rel='alternate' type='text/html' href='http://javascriptdiaries.blogspot.com/2006/02/marquee-beta.html' title='Marquee - Beta'/><author><name>Daniel Guerrero</name><uri>http://www.blogger.com/profile/05241701013236428539</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_VLsxbNGyq_o/SaXyy_eH3DI/AAAAAAAAAAY/twMklEtAHig/S220/danguer_medium.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21713417.post-113864332861246181</id><published>2006-01-30T11:31:00.000-06:00</published><updated>2006-01-31T10:44:33.463-06:00</updated><title type='text'>Double Click</title><content type='html'>This is an easy way to implement double click in Javascript:&lt;br /&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; var last = 0;&lt;br /&gt; var delay = 400; /*the number of miliseconds allowed &lt;br /&gt;   between a couple of clicks to be&lt;br /&gt;   taked as double click */&lt;br /&gt;&lt;br /&gt; function doubleClick()&lt;br /&gt; {&lt;br /&gt;  time = new Date();&lt;br /&gt;  lap = time.getTime();&lt;br /&gt;  click = document.getElementById("click");&lt;br /&gt;  &lt;br /&gt;  if (lap - last &amp;lt; delay) //if it's less than 0.4 seconds&lt;br /&gt;  {&lt;br /&gt;   /* part to fire the event, you can delete the following line */&lt;br /&gt;   click.innerHTML = "Double Click ["+lap+" - "+last+"]";&lt;br /&gt;   last = 0;&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;   last = lap;&lt;br /&gt;   click.innerHTML = "";&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see, the code is simple, the part of: &lt;code&gt;if (lap - last &amp;lt; delay)&lt;/code&gt; is where the event is fired, if has been double click between a certain delay, in this case 400 miliseconds (0.4 seconds).&lt;br /&gt;In this case I'm showing an alert in a div when the double click happens, when there is no double click, I only clean the div (&lt;code&gt;else&lt;/code&gt; part). &lt;br /&gt;&lt;br /&gt;All the page is:&lt;br /&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt; &amp;lt;script language="JavaScript"&amp;gt;&lt;br /&gt; var last = 0;&lt;br /&gt; var delay = 400; //the number of miliseconds allowed &lt;br /&gt;   //between a couple of clicks to be&lt;br /&gt;   // taked as double click&lt;br /&gt;&lt;br /&gt; function doubleClick()&lt;br /&gt; {&lt;br /&gt;  time = new Date();&lt;br /&gt;  lap = time.getTime();&lt;br /&gt;  click = document.getElementById("click");&lt;br /&gt;  &lt;br /&gt;  if (lap - last &amp;lt; delay) //if it's less than 0.4 seconds&lt;br /&gt;  {&lt;br /&gt;   click.innerHTML = "Double Click ["+lap+" - "+last+"]";&lt;br /&gt;   last = 0;&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;   last = lap;&lt;br /&gt;   click.innerHTML = "";&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt; &amp;lt;a href="javascript:doubleClick();"&amp;gt;Double click on this link&amp;lt;/a&amp;gt;&lt;br /&gt; &amp;lt;div id="click"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Other Ways to implement double click&lt;/h2&gt;&lt;br /&gt;The most "standard" way to implement double click is simple using &lt;code&gt;ondblclick&lt;/code&gt; event (&lt;code&gt;&amp;lt;a href="void(0);" ondblclick="doubleClick();"&amp;gt;Double Click&amp;lt;/a&amp;gt;&lt;/code&gt;, which seems to work without problems in IE and Netscape, but of course you can always rely on a self implementation and look as a hacker =)&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Example&lt;/h2&gt;&lt;br /&gt;&lt;a href="http://www.danguer.com/articles/diaries/javascript/double_click/"&gt;Test Double Click&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21713417-113864332861246181?l=javascriptdiaries.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javascriptdiaries.blogspot.com/feeds/113864332861246181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21713417&amp;postID=113864332861246181' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21713417/posts/default/113864332861246181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21713417/posts/default/113864332861246181'/><link rel='alternate' type='text/html' href='http://javascriptdiaries.blogspot.com/2006/01/double-click.html' title='Double Click'/><author><name>Daniel Guerrero</name><uri>http://www.blogger.com/profile/05241701013236428539</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_VLsxbNGyq_o/SaXyy_eH3DI/AAAAAAAAAAY/twMklEtAHig/S220/danguer_medium.jpg'/></author><thr:total>0</thr:total></entry></feed>
