{"action":"created","issue":{"url":"https://api.github.com/repos/mattbryson/TouchSwipe-Jquery-Plugin/issues/272","labels_url":"https://api.github.com/repos/mattbryson/TouchSwipe-Jquery-Plugin/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/mattbryson/TouchSwipe-Jquery-Plugin/issues/272/comments","events_url":"https://api.github.com/repos/mattbryson/TouchSwipe-Jquery-Plugin/issues/272/events","html_url":"https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/issues/272","id":122034077,"number":272,"title":"Problem with preventing click on anchor (\"a\"), bug?","user":{"login":"saturday1","id":6339163,"avatar_url":"https://avatars.githubusercontent.com/u/6339163?v=3","gravatar_id":"","url":"https://api.github.com/users/saturday1","html_url":"https://github.com/saturday1","followers_url":"https://api.github.com/users/saturday1/followers","following_url":"https://api.github.com/users/saturday1/following{/other_user}","gists_url":"https://api.github.com/users/saturday1/gists{/gist_id}","starred_url":"https://api.github.com/users/saturday1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saturday1/subscriptions","organizations_url":"https://api.github.com/users/saturday1/orgs","repos_url":"https://api.github.com/users/saturday1/repos","events_url":"https://api.github.com/users/saturday1/events{/privacy}","received_events_url":"https://api.github.com/users/saturday1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-14T12:34:26Z","updated_at":"2015-12-14T13:59:00Z","closed_at":null,"body":"Hello!\r\n\r\nI have a jQuery script that does this (I have slimmed it down a bit to make it more understandable):\r\n\r\n```javascript\r\nswipeLeft:function(event, direction, distance, duration, fingerCount, fingerData) {\r\n\t$(this).find('a').click(function(e) {\r\n\t\te.preventDefault();\r\n\t});\r\n\tthumbs.goToNextSlide();\r\n},\r\nswipeRight:function(event, direction, distance, duration, fingerCount, fingerData) {\r\n\t$(this).find('a').click(function(e) {\r\n\t\te.preventDefault();\r\n\t});\r\n\tthumbs.goToPrevSlide();\r\n},\r\n\r\n```\r\n\r\nIt is running on a slideshow, and I have removed \"a\" from \"excludedElements\". \r\n\r\nSo what do I want the script to do? Since each slide is an anchor with image I want to prevent click when swiping. This works this far: After reload, I can click the slide to go to the link. I can swipe images without firing the link. But after 2 swipes, I can not click the slide any longer. It is prevented, even if no swipe.\r\n\r\nTest:\r\n1. Click on a slide (Link should work)\r\n2. Swipe one time, click the slide (link should work)\r\n3. Swipe more then two times (Link does not fire anymore)\r\n\r\nIn other words, I want the link to fire on click/tap. But if you swipe I ofc do not want the link/anchor to fire.\r\n\r\nIs there a way to get rid of the \"bug\"? To test this, look at: http://cdn.axiell.com/dev/slippry/index.html\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mattbryson/TouchSwipe-Jquery-Plugin/issues/comments/164444526","html_url":"https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/issues/272#issuecomment-164444526","issue_url":"https://api.github.com/repos/mattbryson/TouchSwipe-Jquery-Plugin/issues/272","id":164444526,"user":{"login":"saturday1","id":6339163,"avatar_url":"https://avatars.githubusercontent.com/u/6339163?v=3","gravatar_id":"","url":"https://api.github.com/users/saturday1","html_url":"https://github.com/saturday1","followers_url":"https://api.github.com/users/saturday1/followers","following_url":"https://api.github.com/users/saturday1/following{/other_user}","gists_url":"https://api.github.com/users/saturday1/gists{/gist_id}","starred_url":"https://api.github.com/users/saturday1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saturday1/subscriptions","organizations_url":"https://api.github.com/users/saturday1/orgs","repos_url":"https://api.github.com/users/saturday1/repos","events_url":"https://api.github.com/users/saturday1/events{/privacy}","received_events_url":"https://api.github.com/users/saturday1/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T13:59:00Z","updated_at":"2015-12-14T13:59:00Z","body":"Tried this, still same result though:\r\n\r\n```javascript\r\nif(direction == 'right' || direction == 'left') {\r\n\tjQuery(this).find('a').click(function(e) {\r\n\t\te.preventDefault();\r\n\t});\r\n} else {\r\n\tjQuery(location).href(jQuery(this).find('a'));\r\n};\r\n```\r\n"}}