"JQuery 토스트 toastr"의 두 판 사이의 차이

(새 문서: jQuery 토스트 toastr ==예시== <source lang='JavaScript'> <link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css'/> <script src='//code...)
 
잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 5명의 중간 판 22개는 보이지 않습니다)
1번째 줄: 1번째 줄:
jQuery 토스트 toastr
==개요==
;jQuery 토스트 toastr
<syntaxhighlight lang='jQuery'>
toastr.success('내용', '제목');
toastr.warning('내용', '제목');
toastr.error('내용', '제목');
</syntaxhighlight>


==예시==
==예시==
<source lang='JavaScript'>
<syntaxhighlight lang='jQuery'>
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css'/>
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css'/>
<script src='//code.jquery.com/jquery.min.js'></script>
<script src='//code.jquery.com/jquery.min.js'></script>
8번째 줄: 14번째 줄:
<script>
<script>
$(function() {
$(function() {
    $('#show-toast1').click( function() {
toastr.options = {
toastr.options = {
"progressBar": true,
"progressBar": true,
"timeOut": 1000,
}
}
$('#show-toast').click( function() {
        toastr.warning("안녕하세요?", "제목", {timeOut: 5000});
toastr["success"]("안녕하세요?")
    });
});
    $('#show-toast2').click( function() {
toastr.options = {
"progressBar": true,
"timeOut": 1000,
}
        toastr.warning("안녕하세요?", "제목", {timeOut: 5000});
    });
});
});
</script>
</script>


<button id='show-toast'>토스트!</button>
<button id='show-toast1'>토스트 #1</button>
</source>
<br>
<jsfiddle>rkw1kmgd</jsfiddle>
<br>
<button id='show-toast2'>토스트 #2</button>
</syntaxhighlight>
<jsfiddle height='350'>rkw1kmgd</jsfiddle>
 
==같이 보기==
*[[팝업 알림]]


==참고 자료==
==참고==
*https://github.com/CodeSeven/toastr
*https://github.com/CodeSeven/toastr
*http://codeseven.github.io/toastr/demo.html


[[분류: jQuery]]
[[분류: jQuery]]

2020년 11월 2일 (월) 02:53 기준 최신판

1 개요[ | ]

jQuery 토스트 toastr
toastr.success('내용', '제목');
toastr.warning('내용', '제목');
toastr.error('내용', '제목');

2 예시[ | ]

<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css'/>
<script src='//code.jquery.com/jquery.min.js'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js'></script>
<script>
$(function() {

    $('#show-toast1').click( function() {
	toastr.options = {
		"progressBar": true,
		"timeOut": 1000,
	}
        toastr.warning("안녕하세요?", "제목", {timeOut: 5000});
    });
    $('#show-toast2').click( function() {
	toastr.options = {
		"progressBar": true,
		"timeOut": 1000,
	}
        toastr.warning("안녕하세요?", "제목", {timeOut: 5000});
    });
});
</script>

<button id='show-toast1'>토스트 #1</button>
<br>
<br>
<button id='show-toast2'>토스트 #2</button>

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}