{"id":15931921,"url":"https://github.com/victornpb/zoomnpan","last_synced_at":"2025-06-16T03:35:50.531Z","repository":{"id":75331425,"uuid":"90518670","full_name":"victornpb/ZoomNPan","owner":"victornpb","description":"Use mouse wheel to zoom an image and move the mouse to pan around. Just using vanilla javascript in 50 lines.","archived":false,"fork":false,"pushed_at":"2017-08-09T19:07:29.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T14:11:15.537Z","etag":null,"topics":["javascript-library","mouse","mouse-wheel","pan","vanilla-javascript","zoom-images","zooming-panning-moving"],"latest_commit_sha":null,"homepage":null,"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/victornpb.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-07T08:23:48.000Z","updated_at":"2023-03-01T05:55:46.000Z","dependencies_parsed_at":"2023-06-06T04:30:33.687Z","dependency_job_id":null,"html_url":"https://github.com/victornpb/ZoomNPan","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/victornpb%2FZoomNPan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victornpb%2FZoomNPan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victornpb%2FZoomNPan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victornpb%2FZoomNPan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victornpb","download_url":"https://codeload.github.com/victornpb/ZoomNPan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248992469,"owners_count":21195050,"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-library","mouse","mouse-wheel","pan","vanilla-javascript","zoom-images","zooming-panning-moving"],"created_at":"2024-10-07T01:40:56.247Z","updated_at":"2025-04-15T02:24:06.781Z","avatar_url":"https://github.com/victornpb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZoomNPan\nUse mouse wheel to zoom an image and move the mouse to pan around. Just using vanilla javascript in 50 lines.\n\nLive example:\nhttp://jsfiddle.net/Victornpb/1s3nm8h8/\n\nUsage\n----\n\nWorks on any div that have a background image\n\nHTML\n```\n\u003cdiv id=\"myDiv\" style=\"background: url('cat.jpg')\"\u003e\u003c/div\u003e\n```\n\nJavascript\n```\nvar zp = new ZoomNPan(myDiv); //That's it!\n```\n# API\n\n## Properties\n\n- minimum zoom allowed (in percent)  \n    `ZoomNPan.minScale = 30;`\n    \n - maximun zoom allowed (in percent)  \n   `ZoomNPan.maxScale = 300;`\n    \n - Snap to 100% if the zoom is in +- this amount (in percent)  \n    `ZoomNPan.snap = 9;`\n    \n - invert the direction on MacOS  \n    `ZoomNPan.invertOnMac = false;`\n    \n    \n## Methods\n    \n - theardown the events and remove styles, call this when you don't need it anymore.   \n    `ZoomNPan.destroy()`\n    \n-----\n\n## Suggestions / Questions\n\nFile a [issue](https://github.com/victornpb/ZoomNPan/issues) on this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictornpb%2Fzoomnpan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictornpb%2Fzoomnpan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictornpb%2Fzoomnpan/lists"}