mirror of
https://github.com/Fechin/reference.git
synced 2026-11-20 21:23:11 +03:00
Update style of collapsible list
This commit is contained in:
1 parent
92e9af0567
commit
40cdf0dc8e
2 files changed
+15
-8
No files matched your search
@@ -38,14 +38,19 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mdLayout .h3-wrap > .section > ul.collapsible > li.active > pre {
|
||||
.mdLayout .h3-wrap > .section > ul.collapsible > li.active > pre {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mdLayout .h3-wrap > .section > ul.collapsible > li.arrow-down:before {
|
||||
.mdLayout .h3-wrap > .section > ul.collapsible > li > strong:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mdLayout .h3-wrap > .section > ul.collapsible > li > strong.arrow-down:before {
|
||||
content: "▼"; /*▼*/
|
||||
}
|
||||
.mdLayout .h3-wrap > .section > ul.collapsible > li:before {
|
||||
|
||||
.mdLayout .h3-wrap > .section > ul.collapsible > li > strong:before {
|
||||
content: "▶"; /*▼*/
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
|
||||
@@ -73,11 +73,13 @@ window.addEventListener('load', () => {
|
||||
});
|
||||
|
||||
/******** List Collapsible ***********/
|
||||
document.querySelectorAll("ul.collapsible > li").forEach(function (li) {
|
||||
li.classList.add("active");
|
||||
li.addEventListener("click", function () {
|
||||
// this.classList.toggle("active");
|
||||
// this.classList.toggle("arrow-down");
|
||||
document.querySelectorAll("ul.collapsible > li > strong").forEach(function (strong) {
|
||||
let li = strong.parentElement;
|
||||
// li.classList.add("active");
|
||||
// strong.classList.toggle("arrow-down");
|
||||
strong.addEventListener("click", function () {
|
||||
li.classList.toggle("active");
|
||||
this.classList.toggle("arrow-down");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user