Make a folded object completely hidden after folding

The function createFoldingObj() is designed to fold down to a minimum height of 10 pixels. However, if a folded object must hide completely when folded, then try leveraging the on user event of the folded object. The PowerPac sends the following string values with user events to folding objects created with this function:
When folded object receives an on user event with the "end up" string, we will animate the hiding of the entire folded object. To handle the animation we will use pgAnimateCSS().
HOW TO DO IT:
NOTE: If you must make this IE8 compatible, then use pgAnimate() or fadeObject() instead of pgAnimateCSS().
- on user event with value = "begin down"
- on user event with value = "end down"
- on user event with value = "begin up"
- on user event with value = "end up"
When folded object receives an on user event with the "end up" string, we will animate the hiding of the entire folded object. To handle the animation we will use pgAnimateCSS().
HOW TO DO IT:
- Draw a text field; name it "Fold_1" and fill it with some text as shown.
- For the on load page event of the field, execute createFoldingObj() to build a folding object out of our field.
Execute pgAnimateCSS() with all parameters empty to initialize the CSS animation libraries (improves response time on first usage). - For the on user event, add an action that checks for our "end up" string.
OPTIONAL: Only for sake of this example, execute pgTBObjSet() to show the folded object after about 5 seconds. - Turn on Enable IE HTML 5 Display and export the page and test it in your favorite browser. When you click to fold the object, it responds to the on user event when the fold has completed and then the action executes the pgAnimateCSS() animation to hide the object. The object will reshow itself after 5 seconds but that is only added for the sake of this example. The result is pretty cool!
NOTE: If you must make this IE8 compatible, then use pgAnimate() or fadeObject() instead of pgAnimateCSS().