Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

CSS wizardry "dropdowns" in repeating sections

1608262569
Joshua S.
Pro
Sheet Author
API Scripter
I am using a version of the CSS wizardry dropdowns with checkboxes in a sheet to attach one or more runes to abilities and trying to figure it out before I drop it into my sheet. I got it working with a single implementation, but when I put it in a repeating section it starts flickering. It needs to be in a repeating section because there will be multiple abilities and each could have multiple runes attached to it. I think what is going on is that the CSS can't distinguish between the html in the repeating fields and keeps trying to open and then close all of them, but I can't figure out what to do. Code follows, any help is appreciated <fieldset class="repeating_runes"> <div class="container"> <div class="child"> <input type="checkbox" name="attr_void" class="rune void" value="void" /> <span>ᛱ</span> <input type="checkbox" name="attr_fehu" class="rune fehu" value="fehu" /> <span>ᚠ</span> <input type="checkbox" name="attr_uruz" class="rune uruz" value="uruz" /> <span>ᚢ</span> <input type="checkbox" name="attr_thurisaz" class="rune thurisaz" value="thurisaz" /> <span>ᚦ</span> <input type="checkbox" name="attr_cansuz" class="rune cansuz" value="cansuz" /> <span>ᚨ</span> <input type="checkbox" name="attr_raidho" class="rune raidho" value="raidho" /> <span>ᚱ</span> <input type="checkbox" name="attr_kenaz" class="rune kenaz" value="kenaz" /> <span>ᚲ</span> <input type="checkbox" name="attr_gebgift" class="rune gebgift" value="gebgift" /> <span>ᚷ</span> <input type="checkbox" name="attr_wunjo" class="rune wunjo" value="wunjo" /> <span>ᚹ</span> <input type="checkbox" name="attr_hagalaz" class="rune hagalaz" value="hagalaz" /> <span>ᚺ</span> <input type="checkbox" name="attr_naudhneed" class="rune naudhneed" value="naudhneed" /> <span>ᚾ</span> <input type="checkbox" name="attr_isaice" class="rune isaice" value="isaice" /> <span>ᛁ</span> <input type="checkbox" name="attr_jethe" class="rune jethe" value="jethe" /> <span>ᛃ</span> <input type="checkbox" name="attr_eihwas" class="rune eihwas" value="eihwas" /> <span>ᛇ</span> <input type="checkbox" name="attr_pertho" class="rune pertho" value="pertho" /> <span>ᛈ</span> <input type="checkbox" name="attr_elhaz" class="rune elhaz" value="elhaz" /> <span>ᛉ</span> <input type="checkbox" name="attr_sowsun" class="rune sowsun" value="sowsun" /> <span>ᛊ</span> <input type="checkbox" name="attr_tiwaz" class="rune tiwaz" value="tiwaz" /> <span>ᛏ</span> <input type="checkbox" name="attr_berkano" class="rune berkano" value="berkano" /> <span>ᛒ</span> <input type="checkbox" name="attr_ehwo" class="rune ehwo" value="ehwo" /> <span>ᛖ</span> <input type="checkbox" name="attr_mann" class="rune mann" value="mann" /> <span>ᛗ</span> <input type="checkbox" name="attr_claguz" class="rune claguz" value="claguz" /> <span>ᛙ</span> <input type="checkbox" name="attr_dagaz" class="rune dagaz" value="dagaz" /> <span>ᛞ</span> <input type="checkbox" name="attr_ing" class="rune ing" value="ing" /> <span>ᛝ</span> <input type="checkbox" name="attr_othala" class="rune othala" value="othala" /> <span>ᛟ</span> </div> </div> </fieldset> .sheet-container { width: 100px; } .sheet-container, .sheet-child { display: inline-block; } .sheet-child { vertical-align: middle; width: 100px; height: 100px; } .sheet-child input, .sheet-child input + span { display: none; } .sheet-child:hover { background: LightGray; position:absolute; width: 100px; height: auto; z-index: 0; padding: 0px; } /*.sheet-child:hover > div.sheet-void { display: none; }*/ .sheet-child:hover input, .sheet-child:hover input + span { display: inline; } .sheet-child:hover input + span { margin-right: 5% } .sheet-child:hover span { display: inline; } .sheet-child:not(:hover) input.sheet-rune.sheet-void:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-fehu:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-tiwaz:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-berkano:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-ehwo:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-mann:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-claguz:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-ing:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-dagaz:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-othala:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-hagalaz:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-naudhneed:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-isaice:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-jethe:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-eihwas:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-pertho:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-elhaz:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-sowsun:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-thurisaz:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-cansuz:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-raidho:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-kenaz:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-gebgift:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-wunjo:checked + span, .sheet-child:not(:hover) input.sheet-rune.sheet-uruz:checked + span { display: inline-block; }
1608267399

Edited 1608269862
vÍnce
Pro
Sheet Author
Hi Joshua, try changing your hover z-index to "1".  You also might include top:0 to ensure your box of checkboxes doesn't easily lose hover by accident when you move the cursor between rows. .sheet-child:hover { background: LightGray; position: absolute; top:0; width: 100px; height: auto; z-index: 1; padding: 0px; }
1608316622
Joshua S.
Pro
Sheet Author
API Scripter
Yup, that seems to work. So that's what the z-index does, I changed it to zero and it didn't seem to affect anything so I just left it there and forgot about it.
1608329239

Edited 1608329280
vÍnce
Pro
Sheet Author
Joshua S. said: Yup, that seems to work. So that's what the z-index does, I changed it to zero and it didn't seem to affect anything so I just left it there and forgot about it. Great.  I believe you can use z-index to basically assign a layer to an element.  Helps when/if you need various elements to be behind or in front of other elements. Definition and Usage The  z-index  property specifies the stack order of an element. An element with greater stack order is always in front of an element with a lower stack order. Note:   z-index  only works on positioned elements (position: absolute, position: relative, position: fixed, or position: sticky).