Layui front-end framework and layui framework

Source: Internet
Author: User

Layui front-end framework and layui framework

A layer effect needs to be popped up in the project. The layui front-end framework is used, and the pop-up layer effect is mainly used (which can be moved)

Html code

Bind the click method to this tag.

1 <a href = 'javascript:; 'data-method = 'offset' data-type = 'auto' class = 'showmean '> display </a>

Click to display this page

1 <div class = "con-no-ma displayNo" id = "con-no-ma"> 2 display page 3 </div>

Js Code

Function showMean () {layui. use ('lay', function () {var $ = layui. jquery, layer = layui. layer; // trigger event, which is equivalent to setting the parameter var active = {offset: function (othis) {var type = othis. data ('type'), text = othis. text (); layer. open ({title: "Data Association", type: 1, offset: type, // For detailed configuration, refer: http://www.layui.com/doc/modules/layer.html#offset Id: 'lay _ demo' + type, // prevent repeated pop-up content: $ ("# con-no-ma"), // new definition on the page, then bind the id to this btn: 'close all', area: ['1000px ', '500px'], btnAlign: 'C', // The button center shade: 0, // do not display the mask // method of btn yes: function () {layer. closeAll () ;}, // method of the close button in the upper right corner cancel: function () {layer. closeAll () ;}}};}; // bind a click event $ ('. showMean '). on ('click', function () {var othis = $ (this), method = othis. data ('method'); active [method]? Active [method]. call (this, othis ):'';});})}

 

Reference: http://www.layui.com/demo/layer.html

: Http://www.layui.com/

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.