alert 함수 대체 fancyalert 함수 추가

This commit is contained in:
chicpro
2013-10-21 17:13:38 +09:00
parent cb130df525
commit c03bfc6afc
3 changed files with 45 additions and 5 deletions

31
js/jquery.fancyalert.js Normal file
View File

@ -0,0 +1,31 @@
function fancyalert(msg)
{
var w = $(window).width();
var h = $(window).height();
var scroll_top = $(window).scrollTop();
var box;
if (/iP(hone|od|ad)/.test(navigator.platform)) {
if(window.innerHeight - $(window).outerHeight(true) > 0)
h += (window.innerHeight - $(window).outerHeight(true));
}
box = "<div id=\"fancyalert\" style=\"top:"+scroll_top+"px;width:"+w+"px;height:"+h+"px;\">";
box += "<table>";
box + "<tr>";
box += "<td width=\""+w+"\" height=\""+h+"\">"+msg;
box += "<br>";
box += "<button type=\"button\" id=\"fancyalert_close\">확인</button>";
box += "</td>";
box += "</tr>";
box += "</table>";
box += "</div>";
$("body").append(box);
}
$(function() {
$("#fancyalert_close").live("click", function() {
$("#fancyalert").fadeOut().remove();
});
});