{"id":20434028,"url":"https://github.com/zewa666/jquery-touchhold","last_synced_at":"2026-05-29T06:31:21.666Z","repository":{"id":6455682,"uuid":"7695367","full_name":"zewa666/jQuery-Touchhold","owner":"zewa666","description":"A simple jQuery plugin to allow event binding for tap-and-hold events on touch devices","archived":false,"fork":false,"pushed_at":"2013-01-19T08:54:28.000Z","size":103,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-05T06:29:58.289Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zewa666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-18T22:06:53.000Z","updated_at":"2022-04-01T19:22:31.000Z","dependencies_parsed_at":"2022-09-24T02:21:00.507Z","dependency_job_id":null,"html_url":"https://github.com/zewa666/jQuery-Touchhold","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zewa666/jQuery-Touchhold","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewa666%2FjQuery-Touchhold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewa666%2FjQuery-Touchhold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewa666%2FjQuery-Touchhold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewa666%2FjQuery-Touchhold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zewa666","download_url":"https://codeload.github.com/zewa666/jQuery-Touchhold/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zewa666%2FjQuery-Touchhold/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33640627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-15T08:23:27.518Z","updated_at":"2026-05-29T06:31:21.649Z","avatar_url":"https://github.com/zewa666.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jQuery Touchhold Plugin\n=======================\n\njQuery Touchhold provides event bindings for 'tap-and-hold' or 'longtap' events on touch devices. \n\nUnlike other touch libraries with support for long tap events, jQuery TouchHold allows you to bind two different event handlers: \n\n* When the user finishes a long tap, a \"touchhold.end\" event is triggered\n* While the user is still touching the screen, a preliminary \"touchhold.start\" event is triggered signifying that enough time has elapsed for the touch to be considered a long tap, and a second when the user finishes the tap. \n\nThis allows you to provide more responsive visual feedback while the user is tapping on an element, as well as more accurately imitate native iOS behavior for object selection (e.g. copy/paste).\n\njQuery is currently a prerequisite. I haven't tested with Zepto.js, but it's possible it might work.\n\nUsage\n-----\nTo bind an event that fires after a user completes a long tap, you can just write:\n\n```js\n\t$(\"#selector\").touchhold(function() {});\n```\n\nYou can essentially treat .touchhold() like any of the default jQuery event binding helpers (.click(), .doubleclick(), etc).\n\nIf you want a function to be called when the current touch is long enough to be considered a long touch, just pass the function in as an optional second parameter:\n\n```js\n\tvar foo = function() { console.log(\"You completed a long tap.\"); }, \n\t\tbar = function() { console.log(\"You held down your finger long enough.\")};\n\t\t\n\t$(\"#selector\").touchhold(foo, bar);\n```\n\nIf you only want to bind a function to fire on the timeout, you can pass in your favorite falsy value as the first parameter; as long as it's not a function, it won't get called. \n\n\nTo Do\n-----\n* 'touchhold.start' and 'touchhold.end' events can't be bound via .bind or .delegate without having called .touchhold() first on that element.\n* Eliminate jQuery dependency","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzewa666%2Fjquery-touchhold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzewa666%2Fjquery-touchhold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzewa666%2Fjquery-touchhold/lists"}