Hi. Trying to move buttons from under ui menu to the top of page. I have special passage who display header. I hidding original buttons via css and copy nav menu to header
The buttons on the UI bar have event handlers attached to them, so merely copying them wonât work.
Also, IDs on a page should be unique, so you probably should put âUIBar.destroy();â in your JavaScript section to get rid of the UI bar if youâre going to keep the IDs the same in your bar.
If that âspecial passageâ is a something like a PassageHeader or even just a reposition standard Passage, then you can use a combination of a <<link>> macro and a <<run>> macro to call the required UI API functions.
second variant works! Thank you HiEv
Greyelf variant works too, thanks!
Can I also ask what functions (kind of UI.saves) are responsible for moving the history back and forth? Engine.forward and backward move to the beginning of the story and to the end. How do I move to the previous page? I could only find the function responsible for #history-jumpto
The Engine.forward() and Engine.backward() methods should only move you forward or backwards one step in the history (assuming there is such a step in the history).
You can check your position within in the history using State.length and State.size. If State.length === 1, then youâre as far back in the history as you can go. If State.length === State.size, then youâre as far forward in the history as you can go.
If youâre seeing something different than that, then we may have to see your code to figure out whatâs going on.
If youâre not using the game history, then you should set Config.history.maxStates to 1 so that it doesnât waste space storing information which you donât need.
Where would any of this âmenu-navigationâ code go? Header Passage or the Story Interface? I tried to follow the most helpful guidance of these sample pages, given elsewhere. [Sample Code (drv.tw)] - very helpful, thank you! But can not tell how to use the codes above to get a working menu in the header area at the top for a story and need more help pls.