javascript alert는 사용자가 close를 해줘야 하므로 때론 불편하게 느껴집니다.
android에 있는 toast 처럼 자동으로 닫히는 메시지를 보여주는 함수 입니다.
function toast(msg){
var el = document.createElement("div");
el.setAttribute("style","position:absolute;top:50%;left:55%;color:white;background-color:#555555; width:180px; height:25px; text-align:center; margin:auto; padding-top:8px; ");
el.innerHTML = msg;
setTimeout(function(){
el.parentNode.removeChild(el);
},1000);
document.body.appendChild(el);
}
https://sir.kr/g5_tip/7799
게시글 목록
| 번호 | 제목 |
|---|---|
| 86 | |
| 83 | |
| 80 | |
| 79 | |
| 78 | |
| 77 | |
| 76 | |
| 75 | |
| 74 | |
| 71 | |
| 63 | |
| 62 | |
| 61 | |
| 60 | |
| 59 | |
| 57 | |
| 55 | |
| 49 | |
| 48 | |
| 47 | |
| 46 | |
| 41 | |
| 40 | |
| 33 | |
| 28 | |
| 24 | |
| 22 | |
| 19 | |
| 12 | |
| 9 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기