Docs and Demos
showcase
feature
1、解决ios滚动穿透问题
2、支持open,close前后的生命周期
3、支持动画
install
npm install popup --save-dev
How to use?
HTML
<body>
<div class="container">
</div>
<div class="meet-popup">
<div class="meet-popup-mask"></div>
<div class="meet-popup-container">
<div class="popup-header">
<span class="p-left">顶部header数据</span>
<span class="p-right">
<div class="popup-close-icon"></div>
</span>
</div>
<div class="popup-content">
</div>
</div>
</div>
</body>
javascript
####基础使用
const Popup = require('popup');
var popupMsg = new Popup(document.querySelector('.meet-popup'),{
container: '.container',
});
popupMsg.open();
Is it easy to use ? 😂
高级使用
const Popup = require('popup');
var popupMsg = new Popup(document.querySelector('.meet-popup'),{
container: '.container',
header: 'center',
animate: true,
beforeOpen: function(next){
next();
},
afterOpen: function(){
},
beforeClose: function(next){
next()
},
afterClose: function(){
}
});
popupMsg.open();
property | description |
---|
open | show popup |
close | close popup |
demo