{"id":18614936,"url":"https://github.com/andrewjbateman/javascript-click-drag","last_synced_at":"2026-04-27T20:31:20.545Z","repository":{"id":96860515,"uuid":"159233633","full_name":"AndrewJBateman/javascript-click-drag","owner":"AndrewJBateman","description":":clipboard: Javascript30 tutorial 27 of 30 to click and drag on a html page","archived":false,"fork":false,"pushed_at":"2022-03-21T14:58:56.000Z","size":1040,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T01:34:29.111Z","etag":null,"topics":["css","html","javascript","javascript30","tutorial-code"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/AndrewJBateman.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-26T21:14:24.000Z","updated_at":"2022-03-21T14:58:59.000Z","dependencies_parsed_at":"2023-03-30T11:36:20.023Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/javascript-click-drag","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewJBateman/javascript-click-drag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-click-drag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-click-drag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-click-drag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-click-drag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/javascript-click-drag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-click-drag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32354564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["css","html","javascript","javascript30","tutorial-code"],"created_at":"2024-11-07T03:27:31.408Z","updated_at":"2026-04-27T20:31:20.524Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Javascript Click Drag\n\n* Wes Bos Youtube Tutorial: [JavaScript Interface Challenge: Click and Drag to Scroll - #JavaScript30 27/30](https://www.youtube.com/watch?v=C9EWifQ5xqA\u0026index=27\u0026list=PLu8EoSxDXHP6CGK4YVJhL_VWetA865GOH).\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/javascript-click-drag?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/javascript-click-drag?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/javascript-click-drag?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/javascript-click-drag?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Javascript Click Drag](#zap-javascript-click-drag)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Tutorial Code to scroll horizontally using click and drag.\n\n## :camera: Screenshots\n\n![Example screenshot](./img/drag.png).\n\n## :signal_strength: Technologies\n\n* [Javascript v1.9 ECMA-262 ECMAScript 2018](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\n\n## :floppy_disk: Setup\n\n* Open `index.html` in browser. If any code is changed the browser needs to be refreshed.\n\n## :computer: Code Examples\n\n* calculate slider scroll left value from cursor position\n\n```javascript\nslider.addEventListener('mousemove', (e) =\u003e {\n  if (!isDown) return; //stop the function from running\n  console.log(isDown);\n  e.preventDefault(); // prevent selection of text etc inside area.\n  const x = e.pageX - slider.offsetLeft;\n  const scrollMultiple = 3; // scroll 3 pixels for each pixel moved by the mouse.\n  const walk = (x - startX)*scrollMultiple;\n  slider.scrollLeft = scrollLeft - walk;\n  console.log('slider scrollleft', slider.scrollLeft); //max value 4207.2001953125\n});\n```\n\n## :cool: Features\n\n* Scroll speed can be changed.\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working\n* To-Do: Nothing\n\n## :clap: Inspiration\n\n* Wes Bos Youtube Tutorial: [JavaScript Interface Challenge: Click and Drag to Scroll - #JavaScript30 27/30](https://www.youtube.com/watch?v=C9EWifQ5xqA\u0026index=27\u0026list=PLu8EoSxDXHP6CGK4YVJhL_VWetA865GOH).\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fjavascript-click-drag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fjavascript-click-drag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fjavascript-click-drag/lists"}