It looks like you're new here. If you want to get involved, click one of these buttons!
/* Create the Right UI Bar. */ var $rightUiBar = $('<div id="right-ui-bar" class="stowed"></div>').insertAfter("#ui-bar"); var rightTray = $rightUiBar.append('<div id="right-ui-bar-tray"><button id="right-ui-bar-toggle" tabindex="0" title="Toggle the Right UI bar" aria-label="Toggle the Right UI bar" type="button"></button></div>'); var rightBody = $rightUiBar.append('<div id="right-ui-bar-body"></div>'); /* Attach the toggle button click. */ $rightUiBar.find('#right-ui-bar-toggle').ariaClick({label : "Toggle the Right UI bar"}, () => $rightUiBar.toggleClass('stowed')); /* Automatically show the contents of the StoryRightSidebar passage in the right-ui-bar-body element. */ postrender["Display Right Sidebar Contents"] = function (content, taskName) { setPageElement('right-ui-bar-body', 'StoryRightSidebar'); };
Comments
If so could I do something like...
Or like this:
Put this into a passage called PassageReady and the sidebar will pop up in every passage tagged "interface"
You can use the same methods to change the UI-bar within a single passage by executing the stuff within the <<if>>.
I used 2 test passages, placed the code in both and a link from the first, leading to the second. The second passage I tagged "interface".
What am I doing wrong here?
Sorry - my bad. Tested this all out in Twine 2, so any error might stem from that. Don't have time to test this out, but try something like:
and
Instead of
and
Cheers, nice one!