Template:Team:Leeds touchDropDown.js
From 2013.igem.org
(Difference between revisions)
m (Simple Javascript for dropdwon menu touch screen compatibility) |
m |
||
Line 1: | Line 1: | ||
/*! | /*! | ||
- | * AUTHOR: Osvaldas Valutis, www.osvaldas.info | + | * AUTHOR: Osvaldas Valutis, www.osvaldas.info |
- | * | + | * |
- | * Please do check out his site. | + | * Please do check out his site. |
- | * | + | * |
- | * To implement this script, please copy and paste the following url as the javascript source: | + | * To implement this script, please copy and paste the following url as the javascript source: |
- | * <nowiki>https://2013.igem.org/Template:Team:Leeds_touchDropDown.js?action=raw&ctype=text/javascript</nowiki> | + | * <nowiki>https://2013.igem.org/Template:Team:Leeds_touchDropDown.js?action=raw&ctype=text/javascript</nowiki> |
- | * Happy scripting! | + | * Happy scripting! |
- | */ | + | */ |
(function(e,t,n,r){e.fn.doubleTapToGo=function(r){if(!("ontouchstart"in t)&&!navigator.msMaxTouchPoints&&!navigator.userAgent.toLowerCase().match(/windows phone os 7/i))return false;this.each(function(){var t=false;e(this).on("click",function(n){var r=e(this);if(r[0]!=t[0]){n.preventDefault();t=r}});e(n).on("click touchstart MSPointerDown",function(n){var r=true,i=e(n.target).parents();for(var s=0;s<i.length;s++)if(i[s]==t[0])r=false;if(r)t=false})});return this}})(jQuery,window,document) | (function(e,t,n,r){e.fn.doubleTapToGo=function(r){if(!("ontouchstart"in t)&&!navigator.msMaxTouchPoints&&!navigator.userAgent.toLowerCase().match(/windows phone os 7/i))return false;this.each(function(){var t=false;e(this).on("click",function(n){var r=e(this);if(r[0]!=t[0]){n.preventDefault();t=r}});e(n).on("click touchstart MSPointerDown",function(n){var r=true,i=e(n.target).parents();for(var s=0;s<i.length;s++)if(i[s]==t[0])r=false;if(r)t=false})});return this}})(jQuery,window,document) |
Revision as of 10:13, 13 September 2013
/*!
* AUTHOR: Osvaldas Valutis, www.osvaldas.info * * Please do check out his site. * * To implement this script, please copy and paste the following url as the javascript source: * https://2013.igem.org/Template:Team:Leeds_touchDropDown.js?action=raw&ctype=text/javascript * Happy scripting! */
(function(e,t,n,r){e.fn.doubleTapToGo=function(r){if(!("ontouchstart"in t)&&!navigator.msMaxTouchPoints&&!navigator.userAgent.toLowerCase().match(/windows phone os 7/i))return false;this.each(function(){var t=false;e(this).on("click",function(n){var r=e(this);if(r[0]!=t[0]){n.preventDefault();t=r}});e(n).on("click touchstart MSPointerDown",function(n){var r=true,i=e(n.target).parents();for(var s=0;s<i.length;s++)if(i[s]==t[0])r=false;if(r)t=false})});return this}})(jQuery,window,document)