YUI Library Examples: Button Control: Calendar Menu Button

Button Control: Calendar Menu Button

This example demonstrates how to create a Menu Button whose Menu instance displays a Calendar.

Date

Begin by instantiating a Button of type "menu" and an Overlay instance that will house a Calendar instance.

Once the new Button is created, add a listener for its "click" event that will be used to render its Overlay instance as well as to create a new Calendar instance. (Defering the rendering of the Overlay until the firing of the "click" event improves the intial load time of the Button instance.)

Lastly, style the Button with a calendar icon.

Copyright © 2008 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings