Original address: http://sentsin.com/jquery/layer/
Parameters
The core interface: options in thelayer.open (options) :
Type
Type: Number
Default: 0, set the type of the shell, 0 for the message box, 1 for the page layer, and 2 for the load layer
Content
Type: String
Required parameters to control the contents of the projectile layer
Title
Type: string or array
Default: Empty, control layer header, value is string or array, example:
[JavaScript] view plain copy print?
Layer.open ({
Title: [ //or Direct title: ' title '
' title ' ,
' background-color: #0099CC; color: #fff; ' //Title style
],
Content:' contents '
})
Time
Type: Number
Default: None, controls the number of seconds required to auto-close layers, supports integers and floating-point numbers
Style
Type: String
Default: null character, control layer style, very practical, such as
[JavaScript] view plain copy print?
Layer.open ({
Style: ' Border:none; background-color: #78BA32; color: #fff; ' ,
Content:' contents '
})
Btn
Type: Array
Default: An empty array, which controls the displayed buttons, supports 1-2 lengths. Example
[JavaScript] view plain copy print?
Layer.open ({
BTN: [' OK '],
Content:' contents '
})
Shade
Type: Boolean
Default: True to show matte
Shadeclose
Type: Boolean
Default: True to turn off layers when masking is clicked
Anim
Type: Boolean
Default: True if the animation pops up
Fixed
Type: Boolean
Default: True, whether the position of the fixed layer
Top
Type: Number
Default: None, the control layer of the ordinate, generally do not need to set, because the layer will always be vertically horizontally centered, only when the Fixed:false top is valid.
[JavaScript] view plain copy print?
Top: (document.documentelement.clientheight-200)/2 //Vertical Center
Success
Type: Function
The layer succeeds in the popup layer's callback function, returning a parameter to the current layer element object
[JavaScript] view plain copy print ?
-
success: function (Elem) {
-
console.log (elem);
-
}
Yes
Type: Function
Click OK button to trigger the callback function, return a parameter to the current level of the index
[JavaScript] view plain copy print?
Yes: function (index) {
Alert (' clicked Yes ')
Layer.close (Index)
}
No
Type: Function
callback function triggered by the point Cancel button
Cancel
Type: Function
A callback function triggered by the Close button on the top right corner.
End
Type: Function
The callback function after the layer is completely destroyed
Other built-in methods/properties
Layer.v
Static properties
Returns the currently used layer mobile version number
Layer.close (Index)
Method
Used to close a specific layer, index for that particular layer
Layer.closeall ()
Method
Close the layer of all layers on the page
This article is from the "Liu Bofang blog" blog, make sure to keep this source http://liubofang.blog.51cto.com/11162557/1858741
Mobile-side pop-up layer: Layer Mobile API Documentation manual v1.2