瀏覽代碼

fixed issue with links on touch devices (tap wasn't working)

Hakim El Hattab 13 年之前
父節點
當前提交
82fbaaf332
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      js/slideshow.js

+ 6 - 2
js/slideshow.js

@@ -104,9 +104,13 @@ var Slideshow = (function(){
 	 * @param {Object} event
 	 */
 	function onDocumentTouchStart( event ) {
-		
 		// We're only interested in one point taps
-		if (event.touches.length == 1) {
+		if (event.touches.length === 1) {
+			// Never prevent taps on anchors and images
+			if( event.target.tagName.toLowerCase() === 'a' || event.target.tagName.toLowerCase() === 'img' ) {
+				return;
+			}
+			
 			event.preventDefault();
 			
 			var point = {