Mobile-side pop-up layer: Layer Mobile API Documentation manual v1.2

Source: Internet
Author: User

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?

  1. Layer.open ({

  2. Title: [ //or Direct title: ' title '

  3. ' title ' ,  

  4. ' background-color: #0099CC; color: #fff; ' //Title style

  5. ],

  6. Content:' contents '

  7. })


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?

  1. Layer.open ({

  2. Style: ' Border:none; background-color: #78BA32; color: #fff; ' ,  

  3. Content:' contents '

  4. })


Btn

Type: Array

Default: An empty array, which controls the displayed buttons, supports 1-2 lengths. Example

[JavaScript] view plain copy print?

  1. Layer.open ({

  2. BTN: [' OK '],

  3. Content:' contents '

  4. })


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?

    1. 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 ?

    1. success:  function (Elem) {  

    2.     console.log (elem);   

    3. }  

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?

  1. Yes: function (index) {

  2. Alert (' clicked Yes ')

  3. Layer.close (Index)

  4. }

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.