반응형

Jquery alert 입니다. 아래는 사용 예시 화면입니다.



default 부터 하나씩 보여드리겠습니다.

1. default




2.alert


3.confirm


4.iframe



5.prompt









아래는 HTML 코드이다. 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
<a href="javascript:;" id="default">default</a>
 
<br />
<a href="javascript:;" id="alert">alert</a>
 
<br />
<a href="javascript:;" id="confirm">confirm</a>
 
<br />
<a href="javascript:;" id="iframe">iframe</a>
 
<br />
<a href="javascript:;" id="prompt">prompt</a>
 
cs

아래는 클릭 이벤트인 javascript 코드이다.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
$('#default').on('click',function(){
  var data = '<div style="padding:20px;">Lorem ipsum dolor sit amet</div>';
  $.dialogbox({
    type:'default',
    title:'Dialog Title',
    content:data,
    closeCallback:function(){
      $.dialogbox.prompt({
        content:'You closed the dialog',
        time:2000 
      });
    }
  });
});
 
$('#alert').on('click',function(){
  $.dialogbox({
  type:'msg',
  title:'Alert Title',
  icon:1,
  content:'Alert Content',
  btn:['Confirm'],
  call:[
    function(){
      $.dialogbox.close(); 
    }
  ]
});
});
 
$('#confirm').on('click',function(){
$.dialogbox({
  type:'msg',
  title:'Confirm Title',
  content:'Are You Sure?',
  closeBtn:true,
  btn:['Confirm','Cancel'],
  call:[
    function(){
      $.dialogbox.close(); 
      alert(3);
    },
    function(){
      $.dialogbox.close(); 
    }
  ]
});
});
 
 
$('#iframe').on('click',function(){
  $.dialogbox({
  type:'iframe',
  title:'jQueryScript',
  content:'Free jQuery Plugins',
  url:'http://www.jqueryscript.net',
  width:900,
  height:650
});
});
 
$('#prompt').on('click',function(){
 $.dialogbox.prompt({
  content:'Success',
  time:2000 
});
});
cs


jquery alert를 사용하기 위해서는 아래의 css,js,image들을 임포트 및 경로에 두고 사용하여야한다.

해당 jquery alert는 제가 이쁘다고 생각한거기 때문에 더이쁜 jquery alert를 사용하시려면 아래의 링크를 통해 확인하시어 사용하시면 됩니다.







반응형

'개발 > JQuery' 카테고리의 다른 글

[jquery] html 특정영역(div) 이외 클릭시 이벤트  (0) 2022.08.18
[JQuery] 선택자  (0) 2019.02.26

+ Recent posts