The ANYDAY component is defined in day, htc. This component is a package of the calendar unit. The name of the component is determined by the xml namespace defined on the first line.
Just like canlenar.htc, you only have one namespace definition. The reason is that there is no need to call other HTCs on this page. That is to say, the HCT is a leaf HTC. The custom label we define here is DAY. We also define Its behavior, in fact, the definition of the HTML component is the definition of the custom tag behavior, which includes an attribute and an event:
<PUBLIC:COMPONENT tagName="DAY"> <PROPERTY NAME="value"></PROPERTY> <ATTACH EVENT="oncontentready" ONEVENT="fnInit()"<>/ATTACH> </PUBLIC:COMPONENT>
Pay attention to the event oncontentready , when its caller calendar.htc asks to import day.htc and is fully imported, this event will be generated. The handler of the event is fnInit(). Let’s take a look at it:
function fnInit() { document.body.innerHTML = element.value; document.body.className = "clsDay"; defaults.viewLink = document; element.appointments = ""; element.date = element.value; }
fnInit() demonstrates many important HTC chapter. The first line assigns element.value to the innerHTML of the calling page
Attributes. HTML components are always encapsulated in element objects. The value attribute is generally defined in the PROPERTY tag. As a reminder, the actual value is passed in from the calling page, canlendar.htc:
text += '
The cell style is specified on the second line:
document.body.className = "clsDay";
The style class clsDay is defined elsewhere on the page:
<STYLE> .clsDay { width:50; height:50; background-color:lightyellow; align:center; text-align:right; } </STYLE>
Notice that the dates in the calendar are colored bright yellow, which proves that HTC’s format-specific mode is dominated by its caller, namely: calendar.htc.
The third line of fninit() sets the viewlink attribute of the default object. The viewLink attribute is the basis of the HTML component. It can make an HTC document (day.htc) visible to another HTML component (calendar.htc). Here it is viewLink settings:
defaults.viewLink = document;
Note that what you need to connect is the entire document object. The last two lines of fnInit() initialize two internal properties that we will explain later:
element.appointments = "";
element.date =
element.value;
is used for its own display, DAY HTML component is related to mouse click:
When the day is clicked, the user is reminded to add his or her appointment on that day, or modify an existing appointment:
function fnShowAppts() { newAppointments = prompt("Add your appointment:", element.appointments); if (newAppointments != null) element.appointments = newAppointments; document.body.innerHTML = '<FONT COLOR="red">' + element.date + '</FONT>' + "<BR>" + '<FONT SIZE="1">' + element.appointments + '</FONT>'; }
The input mechanism here is very primitive, the user adds a new line tag (< ;BR>), otherwise they will all appear on one line. Finally innerHTML is the date data (element.date) and appointment designation (element.appointments)
of connecting links.
TODAY
The HTML component (today.htc) is very similar to the ANYDAY component (day.htc). The only difference is that the background-color in the style sheet is pink instead of lightyellow, and the font color is blue instead of red.
Notice that the current date in the calendar is pink with blue background.
The above is the fifth content of HTML COMPONENTS. For more related articles, please pay attention to the PHP Chinese website (www.php.cn)!

What does it look like to refactor your own code? John Rhea picks apart an old CSS animation he wrote and walks through the thought process of optimizing it.

CSSanimationsarenotinherentlyhardbutrequirepracticeandunderstandingofCSSpropertiesandtimingfunctions.1)Startwithsimpleanimationslikescalingabuttononhoverusingkeyframes.2)Useeasingfunctionslikecubic-bezierfornaturaleffects,suchasabounceanimation.3)For

@keyframesispopularduetoitsversatilityandpowerincreatingsmoothCSSanimations.Keytricksinclude:1)Definingsmoothtransitionsbetweenstates,2)Animatingmultiplepropertiessimultaneously,3)Usingvendorprefixesforbrowsercompatibility,4)CombiningwithJavaScriptfo

CSSCountersareusedtomanageautomaticnumberinginwebdesigns.1)Theycanbeusedfortablesofcontents,listitems,andcustomnumbering.2)Advancedusesincludenestednumberingsystems.3)Challengesincludebrowsercompatibilityandperformanceissues.4)Creativeusesinvolvecust

Using scroll shadows, especially for mobile devices, is a subtle bit of UX that Chris has covered before. Geoff covered a newer approach that uses the animation-timeline property. Here’s yet another way.

Let’s run through a quick refresher. Image maps date all the way back to HTML 3.2, where, first, server-side maps and then client-side maps defined clickable regions over an image using map and area elements.

The State of Devs survey is now open to participation, and unlike previous surveys it covers everything except code: career, workplace, but also health, hobbies, and more.

CSS Grid is a powerful tool for creating complex, responsive web layouts. It simplifies design, improves accessibility, and offers more control than older methods.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version
God-level code editing software (SublimeText3)

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
