We have a few tutorial that will show you how to include JS and also how to use it with your layer elements. Both our JavasScript Slideshow and Lightbox tutorials manage button actions to show/hide elements so they can both help with your request.
Including Scripts in your Exports
Share Your Knowledge!
Contribute to the community and help other users to benefit from your answer with experience and knowledge.