<script src="https://cdn.jsdelivr.net/npm/@sj-js/crossman/dist/js/crossman.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@sj-js/popman/dist/js/popman.min.js"></script>
<script>
var popman = new PopMan();
</script>
npm i @sj-js/popman
const PopMan = require('@sj-js/popman');
const popman = new PopMan();
For convenience, 1-1 code, which loads and creates a Library in the example, is omitted.
popman.new({OPTIONS})
๋ก POP Element๋ฅผ ๋ฑ๋กํฉ๋๋ค.
popman.new({
id:'pop-test', //Pop Element ID
exp:'50%/90%', //Width and Height
content: 'This is contents.'
});
popman.pop('Element ID')
๋ก POP Element๋ฅผ ํธ์ถํฉ๋๋ค.
popman.pop('pop-test');
๐จโ๐ป
data-pop
์์ฑ์ ์ค์ ํฉ๋๋ค. <div id="pop-test" data-pop data-exp="300/200" >
Pop contents with template
</div>
popman.detect()
๋ฅผ ์ฌ์ฉํ๋ฉด data-pop ์์ฑ์ ๊ฐ์ง element๊ฐ ๋ฑ๋ก๋ฉ๋๋ค. popman.detect();
popman.pop('ID')
๋ฅผ ํธ์ถํ๋ฉด ํ๋ฉด์ ํ์๋ฉ๋๋ค. popman.pop('pop-test');
๐จโ๐ป