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

details (HTML): Preserving open/closed state

1709476171
Isurandil
Pro
Sheet Author
When using <details> you can specify the initial opened state. Unfortunately, but unsurprisingly, every time you open the sheet, the state set in the HTML will be applied again. Is there a way to preserve this state?
1709480975
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Not that I'm aware of. You might be able to control it by using the JQuery implementation ($20) to add/remove a class, but I'm not sure if css can control that.
1712747903
Peter B.
Pro
Sheet Author
I don't think the Roll20 jquery can do that as it is very limited in what it allows. If you want to preserve state for open/close, then you will have to use the checkbox and CSS approach to show/hide content