Quick start to easy.js components
Before using Easy.js components, if you can take a few minutes to look at some of the simple introductory guides below, you'll be more handy when using components. of Simplicity
Easy.js components are as simple as possible at the UI (interface) level, and developers can easily customize the styles they want by modifying CSS styles.
Using a component typically requires only a few lines of JS code. Consistency
Components are as consistent as possible on the interface design, naming conventions. Typically, you can use just about any one component, and other components are easy to get started with. of Modular
Each component is an independent, AMD-compliant module that relies on Easy.js's core library and can be loaded by e.use when used. name Space
The namespaces for all components are e.ui and can be accessed through e.ui.xxxx when the component is loaded. instantiation of
When you use a component, you need to instantiate it with the new keyword, and the first letter of the component class is uppercase.
When instantiated, the first parameter is required and is usually set to instantiate A/group DOM element. This parameter can be a selector string, a DOM element, and an object of Easyjs object.
When instantiated, the second parameter is optional, which is a multiple-selectable object object in a configurable form. Event Handling
A component can be instantiated with an on method to bind an event to a component, as well as a UN method to unload an event. The event types supported by each component can be seen in a detailed description document. In a multiple-selection configuration parameter, there will be no other callbacks except for the possible INIT callback function. Destroying Instances
Component instances can be destroyed by the Destroy method.
Dialog dialog box component Define In:dialog.js
This component is used to create a Dialog dialog box that can contain any content you want to add. The HTML structure of the dialog box is automatically built by the component, and you can create a dialog box by simply passing a simple text, and of course you can also pass the custom HTML structure. The default style of the dialog box is the simple style of Windows 8, and you can also easily customize the style of the dialog box. Dialog (target, [options]) relies on JS: dependent Drag component CSS: Dependent style HTML: component Auto Build parameters Target String | Element | EASYJS Object Required
Target can be a selector string, DOM element, or easyjs Object, matching only the first element, which is used to trigger the event to display the dialog box. Options Object Optional
Configurable parameters in multiple-selection form.
The following table lists the detailed descriptions of the parameters for multiple-selection configurable forms.
| Parameters |
Data Type |
Default Value |
Description |
| AutoClose |
Number |
Null |
The time when the dialog box is automatically closed. |
| Content |
String|html String |
Hello World:) |
The contents of the dialog box, which can be an HTML string. |
| Drag |
Boolen |
True |
Whether the Drag dialog box is allowed. |
| Draghandle |
String| Element|easyjs Object |
Null |
The drag area of the custom dialog box. |
| Effects |
String |
Null |
The name of the animation effect.
fade fade effect.
slide The effect of sliding from top to center.
zoom Scaling effect. |
| Elem |
String| Element|easyjs Object |
Null |
The HTML structure of the custom dialog box. |
| Fixed |
Boolean |
True |
Fixed positioning, false to absolute position relative to body. |
| Height |
String |
Auto |
The height of the dialog box, with units. |
| Left |
String |
Null |
Sets the x-axis positioning value of the dialog box, with units, and the default is horizontally centered. |
| Lock |
Boolean |
False |
Whether the dialog box is locked, the dialog box is locked without a close button, and you cannot use the ESC key to close it. |
| Nofn |
Function |
Null |
Cancels the callback function of the button that points to the dialog element and does not close the dialog box if the function returns FALSE. If this parameter is not set, the Cancel button is not displayed. The Close button also invokes the callback function. |
| Notext |
String |
Cancel |
Cancels the text content of the button. |
| Overlay |
Boolean |
True |
Whether the mask layer is displayed. |
| Title |
String |
Null |
The title of the dialog box, which does not display the title bar of the dialog box. |
| Top |
|