{"id":16347356,"url":"https://github.com/cuth/dragger","last_synced_at":"2025-10-26T02:30:20.633Z","repository":{"id":11500107,"uuid":"13977273","full_name":"cuth/dragger","owner":"cuth","description":"Make anything draggable for mobile and desktop","archived":false,"fork":false,"pushed_at":"2015-02-13T21:41:53.000Z","size":692,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T11:11:26.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"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/cuth.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-10-30T04:28:40.000Z","updated_at":"2023-08-10T01:29:37.000Z","dependencies_parsed_at":"2022-08-30T16:11:33.861Z","dependency_job_id":null,"html_url":"https://github.com/cuth/dragger","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuth%2Fdragger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuth%2Fdragger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuth%2Fdragger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuth%2Fdragger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuth","download_url":"https://codeload.github.com/cuth/dragger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238241444,"owners_count":19439767,"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":[],"created_at":"2024-10-11T00:41:42.022Z","updated_at":"2025-10-26T02:30:20.081Z","avatar_url":"https://github.com/cuth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"dragger\n=======\n\nDragger is a module that gives you the ability to drag anything with either the mouse or touch events. It doesn't do anything to the element except for add listeners. Add the functions 'start', 'drag', and 'stop' to get the position at each step.\n\nDragger(element [, options][, bounds])\n\nExample\n-------\n\n```js\n// Use an element or query selector as the first parameter\n// Use an object to overwrite the defaults for the second parameter\nvar dragger = new Dragger('#elementId', {\n    'start': function (pos) {\n        // drag has started\n        // pos.x is the initial left position\n        // pos.y is the initial top position\n    },\n    'drag': function (pos) {\n        // drag has moved\n        // pos.x is the new left position\n        // pos.y is the new top position\n    },\n    'stop': function (pos, hasChanged) {\n        // mouse or touch has ended\n        if (hasChanged) {\n            // position has changed from the original position\n            // pos.x is the final left position\n            // pos.y is the final top position\n        }\n    },\n    'initX': 0, // set the initial X position if it is not zero\n    'initY': 0, // set the initial Y position if it is not zero\n    'allowVerticalScrolling': true, // set this to allow vertical scrolling on touch devices\n    'allowHorizontalScrolling': true // set this to allow horizontal scrolling on touch devices\n});\n\n// If the position of the element that is being dragged has changed, let the dragger know\ndragger.setPosition({\n    x: 0,\n    y: 0\n});\n\n// If an element can't be dragged past a certain area, set the bounds\ndragger.setBounds(\n    minX: null,\n    maxX: null,\n    minY: null,\n    maxY: null\n});\n\n// Check to see if the dragger handle has moved before allowing a click\ndragger.hasDragged(); // returns true or false\n\n// Disable the instance\ndragger.disable();\n\n// Re-enable the instance\ndragger.enable();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuth%2Fdragger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuth%2Fdragger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuth%2Fdragger/lists"}