+1 vote
by (2.2k points)
So I'm using greyelf's little sidebar from the old forum. Link: https://twinery.org/forum/discussion/6492/sugarcube-2-7-2-creating-a-panel-similar-to-the-ui-bar

I want to make the sidebar unable to be seen for the first few passages, can I make that a thing using tags? I assume I can, if I had some code for the javascript to do it, but I don't know anything about doing that. Could I have some help?

1 Answer

0 votes
by (63.1k points)
selected by
 
Best answer

Easiest solution is to just define a new class in CSS and add that class with DOM macros: 

CSS: 

#right-ui-bar.hidden { display: none; }

Then, in the PassageDone special passage: 

::PassageDone
<<removeclass '#right-ui-bar' 'hidden'>>
<<if tags().includes('hide-right')>>
    <<addclass '#right-ui-bar' 'hidden'>>
<</if>>

Then use the tag 'hide-right' to hide it. 

by (2.2k points)
edited by
Sorry, editted my comment, it worked I just had some issues with spelling, lol.
by (63.1k points)
reshown by
Hm. I must've messed something up. I'll get back to you in a bit of no one else does.
...