Method name |
Describe |
$.layer ({}) |
The core interface, the parameter is an object, the object properties see the list above. Packing methods such as Layer.alert () for $.layer (). |
Layer.v |
Gets the version number. |
Layer.ready (callback) |
The method that is executed after the style file in the layer is loaded is typically used to call layer when the page is loaded, which avoids the confusion caused by the style not being loaded or called. Example:Layer.ready (function () {layer.msg (' Hello layer ');}); |
Layer.alert () |
Re-encapsulation of a single-button message box, Layer.alert (alertmsg, AlertType, Alerttit, Alertyes), four parameters, Alertmsg: Information content (text), AlertType: Hint icon (integer, 0-10 selection), Alerttit: Title (text), Alertyes: callback function for the button. such as: Layer.alert (' Front siege morokata Heart ') |
Layer.confirm () |
Re-encapsulation of the inquiry box, Layer.confirm (conmsg, Conyes, Contit, Conno), four parameters, Conmsg: Message content (text), Conyes: Button callback, Contit: Title (text), Conno: Callback for Button two. Such as: Layer.confirm (' OK delete? ', function () {layer.msg (' Delete succeeded! ‘) }); |
Layer.msg () |
Re-encapsulation of the information frame layer without title bar, Layer.msg (Msgtext, Msgtime, Parme), three parameters, 1.7.0 began to make multiple judgments on the parameters, Msgtext: Information content (text), Msgtime: Automatically turns off waiting seconds (default 2 seconds), if Parme is a number, it will be the icon parameter for MSG, and if Parme is a function, it will be the callback for end after the layer disappears, and if Parme is an object, you can configure {type: Icon type, whether shade:false//is masked, if yes, not configured, Rate: ' Top '//pop-up animation type, specific values see Layer.shift parameter description} |
Layer.tips () |
Re-encapsulation of tips layer, layer.tips (HTML, follow, Parme), three parameters, HTML: Information content (text), follow: Trigger event corresponding selector, Parme is an object containing {time: auto-close required Wait seconds, MaxWidth: Max width, guide: direction, style:tips style (take the style attribute in API table one)} Such as: $ ('. Demo '). Click (function () {layer.tips (' This is the tip ', this);}); |
Layer.load (Parme, LoadIcon) |
Re-encapsulation of the loading layer, if you want to append some text in the loading, you can: Layer.load (' loading '); If Parme is a number, it means that Parme is the longest waiting seconds required to auto-close (0 o'clock does not close automatically), LoadIcon: Load icon (integer, 0-3 selection) such as: Layer.load (0, 1); |
Layer.area (index, options) |
Used to redefine the width height, coordinates, Z-index, and so on for a specified layer. Index is the indexed layer, options contains {width: ', Height: ', top: ', left: ', ZIndex: '} and other CSS properties. This method is only valid for the page layer (type:1) and the IFRAME layer (TYPE:2); This method is 1.6.0 start new |
Layer.index |
static property for obtaining the last-triggered layer index value |
Layer.getchildframe (selector, index) |
Gets the DOM in the child IFrame. Very useful, when the parent window is manipulating the contents of the IFRAME, it can show great divinity. The index parameter is 1.6.0 is new, because multiple IFRAME layers are allowed to be ejected, so you need to use the index index to manipulate the specified layer |
Layer.getframeindex (Window.name) |
Gets the index of the currently-located iframe layer. Only allowed inside the IFRAME page. If you close yourself internally:var i = Parent.layer.getFrameIndex (window.name);p arent.layer.close (i); |
Layer.close (Index) |
Used to manually turn off the layer. The index value of the layer for the parameter. The index is the value returned by the pop-up method. Such as:var i = $.layer ({}); or var i = Layer.alert (), or the like can also return index layer.close (' I '); |
Layer.closeall () |
Used to close all layers, which may be used in multi-layer mode |
Layer.shift (type, rate) |
Built-in animations when the layer pops up, used in the success callback. Type: Animated types, available for seven options, upper left (left-top), Top (top), upper right (right-top), lower right (Right-bottom), lower (bottom), lower left (Left-bottom), left (' Ieft '). Rate: Animation frequency, milliseconds. Such as:Success:function () { layer.shift (' Right-bottom ', 400);//Bottom Right corner popup, 400 ms rate} |
Layer.autoarea (Index) |
It is used to deal with the change of width and height in the layer, and the re-adaptive layer width is high. Required parameter is the index value of the layer |
Layer.iframeauto (Index) |
Used to make the IFRAME layer adaptive. Very practical, if it is within the IFRAME layer, it can be obtained by var index = Layer.getframeindex (window.name), if the parent page, you can call the IFRAME layer return is worthwhile, such as var index = $.layer (); For more details, please refer to the IFRAME parent action shown on the website. |
Layer.setmove () |
This method can be used to re-initialize the drag and drop when the drag element changes. |
Layer.zindex |
Global property for obtaining the maximum z-index value in a layer container |
Layer.settop (Layernow) |
Referencing this method turns on clicking to make the current window top feature, only for use in the success callback, the Layernow parameter is the parameter passed in the success callback function, that is, the current layer container. Type:1/type:2 Multi-window mode may be very useful, when necessary, to configure the ZIndex:layer.zIndex, you can see [strength] One page example: [Page layer] of the infinite layer of the middle |
Layer.path |
A static property that gets the current layer's storage path. |
Layer.use (module, callback) |
Load a module, support loading JS, CSS, when you try to extend a JS module to layer, it will be more tall on it. such as loading a js:layer.use (' Extend/layer.ext.js ', function () {}); Detailed reference Layer.ext.js |