The PowerPac function
fadeObject() is able to do a lot of complex things, so it can seem a little confusing at first to set this up.
Here is an example of your scenario.- I drew a rectangle and named it in this case "FadeME"
- For the onclick event I set the PowerPac function fadeObject() to execute with the following parameters:
![Image 1.png](./download/file.php?id=170)
- FadeObject() parameters to fade object OUT.
- Image 1.png (97.77 KiB) Viewed 7769 times
- Now export the page and view it in a browser. Clicking on the rectangle will cause it to fade out over a period of 2500ms. Works perfect.
There are other ways to fade out an object. You can use
pgAnimateCSS() to perform the fade as well. It is your choice which function to use as they each have their pros and cons.
pgAnimateCSS() allows a greater array of routines while
fadeObject() is far more flexible in controlling the timing and result (e.g.: you can even stop the fade at a certain opacity). Both PowerPac functions,
fadeObject() and
pgAnimateCSS(), provide notification when they have completed. And both functions support groups of objects.
ENJOY!