Hello everyone,
I wrote me a simple sidebar menu using javascript, which is toggled via a button and then slides in from the side. I already got it to work, but I would like to place the button that toggles the menu into the Harlowe sidebar and can't seem to get this to work.
I am new to javascript but I know that there is the possibility to call certain elements from a div-box or even the body and replace them with new strings. Would that also be possible with the tw-sidebar element?
To be clear: I want to replace the undo-redo-buttons or simply everyting in the tw-sidebar with my button that calls the sidebar to appear. If I place them in a passage, everything works fine already. I just want the button out of the way of the main content in the passages.
Comments
I suggest you place the Javascript doing the replacement within a footer tagged passage.
Without an example of your 'toggle button' code it is difficult to create a possible solution.
EDIT: Ok, that wasn't the problem, so I guess I'll just have to wait.
It seems I can't post anything (with code inside?) in this thread anymore, so here is just a link to an example of the code I used to build the sidenav. I used the "Sidenav Overlay Example".
http://www.w3schools.com/howto/howto_js_sidenav.asp
I read about the recreation of the tw-sidebar, but I had to post my script into every passage I wanted to have the sidebar in anyway, because the script didn't execute out of the javascript section and just resulted in an error.
PS: Sorry to the admin, that has to curate all my post-trys here.