Adds a calendar control to the document.
Syntax
XML <Prefix:CustomTag ID=sID STYLE="behavior:url('calendar.htc')" /> HTML <ELEMENT STYLE="behavior:url('calendar.htc')" ID=sID> Scripting object.style.behavior = "url('calendar.htc')" object.addBehavior ("calendar.htc")
Possible Values
Prefix Prefix used to associate CustomTag with a namespace. This prefix is set using the XMLNS attribute of the HTML element. CustomTag User-defined tag. sID String that uniquely identifies the object.
Members
Styles
Remarks
The behavior-defined members listed in the preceding table are not accessible through script until the window.onload event fires. Waiting for this event to fire ensures that the page is completely loaded, that all behaviors have been applied to corresponding elements on the page, and, consequently, that all the behavior's properties, methods, and events are available for scripting. Attempting to use any of the behavior-defined members will result in a scripting error indicating that the object does not support that particular member.
The calendar behavior inserts a calendar control into a Web page. The calendar consists of three main sections:
- The title area displays the month, year, and month and year list boxes.
- Days of the week are ordered horizontally below the title area.
- The individual days of the month, including overlapping days from the previous and following month, are contained in a grid below the days of the week.
The calendar.htc file can be downloaded from the calendar sample page.
Example
This sample demonstrates the implementation and adjustments of the calendar behavior.
<HTML XMLNS:IE> <HEAD> <STYLE> @media all{ IE\:Calendar{ behavior: url(/behaviors/calendar.htc) ; width : 33%; } } </STYLE> </HEAD> <BODY> <IE:Calendar ID = "cal" STYLE = "width: 300; height: 275; border: '1px solid black';" > </IE:Calendar> </BODY> </HTML>
See Also