Corner Buttons

Corner toggle [+] and [-] buttons

With our event listener programming working we can add corner plus and minus buttons. Plus and minus buttons toggle their text from [+] and [-]. We want on on the top left and right corners. Later we will design side panels that show and hide with the plus an dminus buttons.

Corner Buttons()

Everything is much the same as the event-listeners.js program. Here there is the added toggle functionality. It is a simple function that check state and changes the text. Since there are two toggle buttons might as well make it a prototypical class which you can see. There is a second version suffixed with version-1 that makes the two toggle buttons on their own. The file links are listed below.

corner-buttons() src code file link

corner-buttons.js

corner-buttons-version-1.js

corner-buttons() src code screenshot

source code of corner-buttons()

Demo page

Look for the button top left and right corners of the screen. The toggle from [+] and [-].

demo