{"id":16818381,"url":"https://github.com/ninjaprox/segmented-slider-js","last_synced_at":"2025-03-17T13:40:24.049Z","repository":{"id":34251857,"uuid":"38135745","full_name":"ninjaprox/segmented-slider-js","owner":"ninjaprox","description":"A simple slider with three segments","archived":false,"fork":false,"pushed_at":"2015-07-08T18:16:11.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T20:06:21.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ninjaprox.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":"2015-06-26T21:53:19.000Z","updated_at":"2015-07-06T17:38:58.000Z","dependencies_parsed_at":"2022-07-14T19:00:43.808Z","dependency_job_id":null,"html_url":"https://github.com/ninjaprox/segmented-slider-js","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/ninjaprox%2Fsegmented-slider-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninjaprox%2Fsegmented-slider-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninjaprox%2Fsegmented-slider-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ninjaprox%2Fsegmented-slider-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ninjaprox","download_url":"https://codeload.github.com/ninjaprox/segmented-slider-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244043306,"owners_count":20388561,"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-13T10:49:57.339Z","updated_at":"2025-03-17T13:40:24.022Z","avatar_url":"https://github.com/ninjaprox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"segmented-slider-js\n===================\n\n# Introduction\n\nsegmented-slider-js is a simple slider with three segments.\n\nThat's all. No more words. Just use it.\n\n# Demo\n[Have a look](http://ninjaprox.github.io/demo/segmented-slider-js/)\n\n# Requirements\n\n* jQuery\n* jQuery.event.drag\n\nThis control uses `jQuery` and `jQuery.event.drag` as dragging stuff helper.\n\nTherefore, make sure these two libraries are imported already.\n\nYou can learn more jQuery.event.drag [here](http://threedubmedia.com/code/event/drag)\n\n# Usage\n\n## HTML\n\nFirstly, you need to create a skeleton for this control.\n\n```html\n\u003cdiv class=\"segmented-slider\" data-init-green=\"40\" data-init-amber=\"60\"\u003e\n    \u003cul class=\"point-container\"\u003e\n        \u003cli\u003e0\u003c/li\u003e\n        \u003cli\u003e10\u003c/li\u003e\n        \u003cli\u003e20\u003c/li\u003e\n        \u003cli\u003e30\u003c/li\u003e\n        \u003cli\u003e40\u003c/li\u003e\n        \u003cli\u003e50\u003c/li\u003e\n        \u003cli\u003e60\u003c/li\u003e\n        \u003cli\u003e70\u003c/li\u003e\n        \u003cli\u003e80\u003c/li\u003e\n        \u003cli\u003e90\u003c/li\u003e\n        \u003cli\u003e100\u003c/li\u003e\n    \u003c/ul\u003e\n    \u003cdiv class=\"handle-container\"\u003e\n        \u003cdiv class=\"segment green\"\u003e\u003c/div\u003e\n        \u003cdiv class=\"segment amber\"\u003e\u003c/div\u003e\n        \u003cdiv class=\"segment red\"\u003e\u003c/div\u003e\n        \u003cdiv class=\"handle green\"\u003e\u003c/div\u003e\n        \u003cdiv class=\"handle amber\"\u003e\u003c/div\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n```\n\n`data-init-green` and `data-init-amber` attributes are to set the initial position of the green and amber handle.\n\nUnless they are set, the control itself has default value.\n\n## Javascript\n\n```js\n$(\".segmented-slider\").segmentedSlider(function(greenPoint, amberPoint) {\n    // Do your stuff with new green point and amber point value here\n\n    /* Example\n    $(\".handle.green\").text(greenPoint);\n    $(\".handle.amber\").text(amberPoint);\n    */\n});\n```\n# Todo\n\n* Make it responsive\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Nguyen Vinh [@ninjaprox](http://twitter.com/ninjaprox)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninjaprox%2Fsegmented-slider-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fninjaprox%2Fsegmented-slider-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fninjaprox%2Fsegmented-slider-js/lists"}