{"id":25706423,"url":"https://github.com/bh-lay/toucher","last_synced_at":"2025-04-06T20:11:56.933Z","repository":{"id":17377474,"uuid":"20149420","full_name":"bh-lay/toucher","owner":"bh-lay","description":" :point_up_2:  面向移动端的手势类库","archived":false,"fork":false,"pushed_at":"2022-05-19T05:19:05.000Z","size":612,"stargazers_count":261,"open_issues_count":5,"forks_count":157,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-30T18:11:07.852Z","etag":null,"topics":["javascript","touches"],"latest_commit_sha":null,"homepage":"http://bh-lay.github.io/toucher","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bh-lay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-25T07:50:24.000Z","updated_at":"2024-10-06T03:59:43.000Z","dependencies_parsed_at":"2022-09-14T09:11:54.150Z","dependency_job_id":null,"html_url":"https://github.com/bh-lay/toucher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh-lay%2Ftoucher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh-lay%2Ftoucher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh-lay%2Ftoucher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh-lay%2Ftoucher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bh-lay","download_url":"https://codeload.github.com/bh-lay/toucher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543593,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","touches"],"created_at":"2025-02-25T07:33:15.427Z","updated_at":"2025-04-06T20:11:56.893Z","avatar_url":"https://github.com/bh-lay.png","language":"JavaScript","readme":"#toucher是什么\ntoucher是一个面向移动端web开发，通过监听原生事件模拟手势事件的库。\n\n####[使用案例](http://bh-lay.github.io/toucher/)、[demo/图像预览](http://bh-lay.github.io/toucher/swiper/)、[实现原理](http://bh-lay.com/blog/14e212bdbeb)\n\n#目前支持哪些事件\n基本事件\n * singleTap：轻击\n * doubleTap：双击\n * longTap：长按\n * swipeUp：上划\n * swipeRight：右划\n * swipeDown：下划\n * swipeleft：左划\n\n高级事件\n * swipeStart：滑动开始\n * swipe：滑动（阻止浏览器默认事件，滑动过程效果更佳）\n * swipeEnd：滑动结束\n\n#说明\n目前尚不支持双指操作的事件，此类事件可能会在下次大的更新之后作为补充加入进来。\n\n事件触发时不阻止浏览器默认事件，若要用于拖动操作，或滑动更为细腻，可在swipe事件中使用“return false;”阻止浏览器默认事件！\n\n#DEMO\n请使用移动设备或使用调试工具模拟移动设备查看 [demo/案例](http://bh-lay.github.io/toucher/)、[demo/图像预览](http://bh-lay.github.io/toucher/swiper/)\n\n#如何使用\n接口提供了链式调用的实现，及事件委托（仅支持class）。\n\n```javascript\nvar myTouch = util.toucher(document.getElementById('touchBox'));\n\nmyTouch.on('singleTap',function(e){\n    //\n}).on('longTap',function(e){\n\t//\n}).on('singleTap','.checkA',function(e){\n\tconsole.log(this,e);\n\treturn false\n});\n\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbh-lay%2Ftoucher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbh-lay%2Ftoucher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbh-lay%2Ftoucher/lists"}