COOL Sliding ON OFF Buttons Using XML & CSS
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Example of ToolBook export using XML and CSS to create these cool buttons:
NOTE: This is a real ToolBook export embedded in this forum article. You can interact with the button to see the effects!
Download demo files:
HOW TO ACCOMPLISH THIS?
NOTE: This is a real ToolBook export embedded in this forum article. You can interact with the button to see the effects!
Download demo files:
HOW TO ACCOMPLISH THIS?
- Draw 7 fields on the ToolBook page.
Size them to 50px by 26px. Name the fields "Toggle1", "Toggle2" ... "Toggle7". Group them together and name the group "Toggles". These fields will be used as containers for our buttons when the project is exported. Here is my layout:
NOTE: I gave the field a little background color to help in aligning the objects. I also typed the object names into the field for reference only. The size is not hugely important because the XML will resize them to fit the content that is put into them. However, 50 x 26 is that size, so setting it here makes positioning them on the page layout easier.
- Add an action to the on load page event of the group "Toggles" which hides all the object in the group.
- Add an action to the same group and event that loads the XML that will completely configure the page and load the CSS.
- Create the CSS file as shown below and name it "toggles.css". Save it in the same folder as your book. If you actually use this in one of your projects, you can modify any of the classes in the file to change the look and feel.
- Create the XML file as shown below and name it "toggles.xml". Save it in the same folder as your book. If you actually use this in one of your projects, you will have to modify the file based on the number of buttons, etc.
- Flag both files for inclusion in your export by using the DHTML Export Tree Manager:
- EXPORT your book and you should have a result similar to the one in the demo above. Of course, I've added some page styling and a first page transition when the book loads. There are other topics in this forum that discuss these excellent features of the latest releases of the PowerPac for ToolBook.