JQuery 토스트 toastr

1.229.201.5 (토론)님의 2019년 9월 3일 (화) 13:46 판 (→‎예시)

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": 5000,
	}
		toastr.success("안녕하세요?")
	});
    $('#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 }}