PopMan

๐Ÿ’ฌ

Build Status All Download Release License

Index

1. Getting Started

1-1. How to load?

1-2. Simple Example

For convenience, 1-1 code, which loads and creates a Library in the example, is omitted.

Exapmle - popman.pop() with script
  1. popman.new({OPTIONS})๋กœ POP Element๋ฅผ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

     popman.new({
         id:'pop-test', //Pop Element ID
         exp:'50%/90%', //Width and Height
         content: 'This is contents.' 
     });
    
  2. popman.pop('Element ID')๋กœ POP Element๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.

     popman.pop('pop-test');
    
  3. ๐Ÿ‘จโ€๐Ÿ’ป

    <body> Hello Popman <button onclick="popman.pop('pop-test');">POP</button> <div id="tester">TEST</div> </body> <script> popman.setup({modeTest:true}); popman.new({ id:'pop-test', exp:'50%/90%', closebyesc:true, content:'This is contents. <br/><br/>', modeAuto:true, //Open automatically add:function(data){ document.getElementById('tester').innerHTML = 'When add'; }, pop:function(data){ document.getElementById('tester').innerHTML = 'When pop'; }, close:function(data){ document.getElementById('tester').innerHTML = 'When close'; } }); </script>
Exapmle - popman.pop() with template
  1. Pop Element์— data-pop์†์„ฑ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
     <div id="pop-test" data-pop data-exp="300/200" >
         Pop contents with template
     </div>
    
  2. popman.detect()๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด data-pop ์†์„ฑ์„ ๊ฐ€์ง„ element๊ฐ€ ๋“ฑ๋ก๋ฉ๋‹ˆ๋‹ค.
     popman.detect();
    
  3. popman.pop('ID')๋ฅผ ํ˜ธ์ถœํ•˜๋ฉด ํ™”๋ฉด์— ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
     popman.pop('pop-test');
    
  4. ๐Ÿ‘จโ€๐Ÿ’ป

    <script> popman.setup({modeTest:true}).detect(); </script> <body> <button onclick="popman.pop('pop-test');">POP</button> <div id="pop-test" data-pop data-exp="300/200" data-closebyclickin data-mode-auto> <br/> <div id="divAlertMsg" style="font-size:35px; color:white; border:2px solid; background:#F08047;"> TEST </div> <div id="divAlert1stMsg"> TEST </div> </div> </body>
Exapmle - popman.alert()
Exapmle - popman.confirm()
Exapmle - popman.loading()