Ten-minute learning to use the js framework component ---- ymPrompt message prompt component
This component includes various messaging components that we often use.
For example:
YmPrompt. alert (parameter) // Message Type
YmPrompt. succeedInfo (parameter) // successful information type
YmPrompt. errorInfo (parameter) // error message type
YmPrompt. confirmInfo (parameter) // you can specify the message type.
YmPrompt. win (parameter) // customize the window type
And the parameter sequences are the same. If you don't need them, simply use null.
The parameters are
Message: the content to be displayed by the message component. The default value is "content ".
Width: the width of the message box. The default value is 300.
Height: the height of the message box. The default value is 185.
Title: Message component title. The default value is "title"
Handler: callback function. When the OK, cancel, or close button is clicked, the function is triggered and the clicked button identifier is passed in. For example, "OK" indicates "OK", "cancel" indicates "canceled", and "close" indicates "disabled ".
MaskAlphaColor: Specifies the color of the mask. The default value is black.
MaskAlpha: Specifies the transparency of the mask. The default value is 0.1.
FixPosition: determines whether the pop-up box is floating along with the scroll bar, and remains at a fixed position on the screen. The default value is false.
DragOut: determines whether to allow dragging out of the screen range. The default value is true.
AutoClose: set to automatically close the window after you click the button in the window. The default value is true (if set to false, close the window by calling the close method in the program ).
TitleBar: whether to display the title bar. It is displayed by default. NOTE: If there is no title bar, you need to control and close it in the program.
ShowMask: whether to display the mask layer. The default value is true.
WinPos: the position of the pop-up window. Eight built-in positions (c, l, t, r, B, lt, rt, lb, rb) and custom window coordinates are supported, the default value is c.
Meaning of each parameter: c: center of the page, l: left side of the page, t: top of the page, r: Right side of the page, B: top of the page, lt: top left corner, rt: top right corner, lb: lower left corner, rb: lower right corner
// The following three parameters are mainly used for the win method (you can also set these parameters to overwrite the default attributes of the previous four message types ).
Iframe: whether to use the iframe method to load content. If this attribute is true, the component tries to load the message content as a url. The default value is false.
IcoCls: icon type. The imported content is classname. you can refer to the definition of icons in ymprompt.css by using the method of writing. The default value is null.
Btn: button definition. The input is in the array format. The format of each button is ['button text', 'button identifier'], for example, [[['OK', 'OK'], ['cancel', 'cancel'], ['close', 'close.
Note that a single button should be like this: [['OK', 'OK']
// The following parameters can be used to localize component languages, for example, in an English system.
OkTxt: Specifies the text description of the OK button. The default value is "OK"
CancelTxt: text description of the cancel button. The default value is "cancel"
CloseTxt: text description of the close button (displayed when you place the cursor over the close button). The default value is "close"
Therefore, you only need to reference the relevant js and css files to use the default or custom effect.
For example, ymPrompt. confirmInfo ('information validation box function test', null, handler) can achieve perfect results.
As follows:
Http://www.codefans.net/soft/8800.shtml