{"id":26910142,"url":"https://github.com/ht-devx/slidetoggle","last_synced_at":"2026-01-30T13:03:28.492Z","repository":{"id":244328261,"uuid":"814923317","full_name":"ht-devx/slideToggle","owner":"ht-devx","description":"🛠️ ⸨ plugin ⸩  slideToggle in JavaScript by animating CSS grid-template-rows","archived":false,"fork":false,"pushed_at":"2024-08-23T21:01:06.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T04:47:41.412Z","etag":null,"topics":["slide-toggle","slidedown","slidetoggle","slideup","toggleslide"],"latest_commit_sha":null,"homepage":"https://ht-devx.github.io/slideToggle/","language":"HTML","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/ht-devx.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":"2024-06-14T02:00:20.000Z","updated_at":"2024-08-23T21:01:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfc70b53-32d0-4057-b1f4-896251e0fb6f","html_url":"https://github.com/ht-devx/slideToggle","commit_stats":null,"previous_names":["ht-devx/slidetoggle"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ht-devx/slideToggle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ht-devx%2FslideToggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ht-devx%2FslideToggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ht-devx%2FslideToggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ht-devx%2FslideToggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ht-devx","download_url":"https://codeload.github.com/ht-devx/slideToggle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ht-devx%2FslideToggle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28913312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: 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":["slide-toggle","slidedown","slidetoggle","slideup","toggleslide"],"created_at":"2025-04-01T13:31:23.194Z","updated_at":"2026-01-30T13:03:28.476Z","avatar_url":"https://github.com/ht-devx.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"### slideToggle\n\nA plugin that replicates jQuery's `slideToggle()` function in pure JavaScript by utilizing CSS transitions with `grid-template-rows`.\n\n**Preview / Demo:** [ht-devx.github.io/slideToggle](https://ht-devx.github.io/slideToggle)\\\n**Demo code:** [jsfiddle.net/ht_dev/fua53ngr](https://jsfiddle.net/ht_dev/fua53ngr)\\\n**Author:** HT ([@ ht-devx](https://github.com/ht-devx))\\\n**Release date:** 2024-06-13\\\n**Last updated:** 2024-06-13 8:28PM [GMT-7]\n\n---\n\n#### Table of Contents:\n* [About](#slidetoggle)\n* [How to Use](#how-to-use)\n* [Usage Notes](#usage-notes)\n* [Attribution](#attribution)\n* [Troubleshooting](#troubleshooting)\n* [Credits](#credits)\n\n---\n\n#### How to use:\n\nInclude the following after `\u003chead\u003e`:\n```html\n\u003c!----- 【 slideToggle: @ht-devx 】 -----\u003e\n\u003clink href=\"https://ht-devx.github.io/slideToggle/slideToggle.css\" rel=\"stylesheet\"\u003e\n\u003cscript src=\"https://ht-devx.github.io/slideToggle/slideToggle.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\nslideToggle({\n    trigger: \"#your_button\", // change this to your trigger's selector\n    content: \"#your_content\" // change this to your content's selector\n})\n\u003c/script\u003e\n\n\u003cstyle\u003e\n:root {\n    --SlideToggle-Speed-1: 500ms;\n    --SlideToggle-Speed-2: 1s;\n}\n\n/* in the next line, change .content to your content's selector */\n.content:not(.slidetoggle-content){\n    display:none;\n}\n\u003c/style\u003e\n```\n\nWhat's happening in this example:\n- Clicking an element called `#your_button` will cause an element called `#your_content` to slide toggle.\n- On the 1st slide animation (revealing the content), it expands at the speed of `--SlideToggle-Speed-1`, which is set to `500ms`.\n- On the 2nd slide animation (hiding the content), it retracts at the speed of `--SlideToggle-Speed-2`, which is set to `1s`.\n- [optional] `.content:not(.slidetoggle-content)` with the CSS `display:none` hides content until the user interacts with it.\n\n---\n\n#### Usage notes:\nIf you have multiple contents you want to slide toggle, and want to auto-generate your **trigger** and **content** pairings based on naming patterns (e.g. numbered elements), with this HTML markup as an example (here, the numbered pattern is assigned in the `data-id` attribute):\n```html\n\u003cbutton class=\"button\" data-id=\"1\"\u003eone's button\u003c/button\u003e\n\u003cdiv class=\"content\" data-id=\"1\"\u003eone's content\u003c/div\u003e\n\n\u003cbutton class=\"button\" data-id=\"2\"\u003etwo's button\u003c/button\u003e\n\u003cdiv class=\"content\" data-id=\"2\"\u003etwo's content\u003c/div\u003e\n```\n\nYou can call the plugin like this:\n```javascript\nlet triggerName = \"button\"; // change this to your trigger selector\nlet attrName = \"data-id\"; //  change this to your numbered attribute\nlet contentName = \".content\"; // change this to your content selector\n\n// if you modify the 3 lines above, you don't need to touch anything here\ndocument.querySelectorAll(triggerName)?.forEach(btn =\u003e {\n    let getID = btn.getAttribute(attrName);\n    slideToggle({\n        trigger: btn,\n        content: [...document.querySelectorAll(contentName)].find(x =\u003e x.getAttribute(attrName) == getID)\n    })\n})\n```\n\n---\n\n#### Attribution:\nNo visible credit/attribution is required, but please do not remove the existing credits in the code. A link to this repository would be appreciated.\n\n---\n\n#### Troubleshooting:\nIf you need further assistance, please contact me at: [hello.ht.dev@gmail.com](mailto:hello.ht.dev@gmail.com)\n\n---\n\n#### Credits:\n\n`height:auto` animation via `grid-template-rows` by [Nelson Menezes](https://nemzes.net/posts/animating-height-auto).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fht-devx%2Fslidetoggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fht-devx%2Fslidetoggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fht-devx%2Fslidetoggle/lists"}