[Notes]
1. When using, please place the entire folder layer in any directory of your site, and just introduce layer.js. , except for jQuery, other files do not need to be introduced.
2. If your js import is processed through merging or you do not want to use the absolute path automatically obtained by layer, you can configure it through layer.config() (see the official website API page for details)
3. jquery requires 1.8
After downloading the layer, deploy it to any directory in your project (of course, we recommend placing it in the front-end related directory). You cannot move the file structure in the layer. Because they are an inseparable combination. Like this: (Special note: You need to introduce the entire layer folder into your file, not just the layer.js file)
You don’t have to worry about those files What is it for? You only need to identify one file: layer.js. That’s right, when you try to present the layer on the page, you should do it like this: (the simplest example)
$("#btn").bind("click",function(){ //layer.msg('点我的人最美!'); layer.msg('此商品不存在或者已下架,看看其他商品吧!', { time: 3000 }); });
More Example:
For more layui knowledge, please pay attention to thelayui usage tutorialcolumn.
The above is the detailed content of layui-layer independent component-pop-up layer introduction. For more information, please follow other related articles on the PHP Chinese website!