";
if (sign!="")s+=" | ";
s+=""+msg+" |
";
if (sign=="confirm"){
s+="
确 定取 消";
}else{
s+="
确 定"
}
s+="
";
$("body").append(s);
$("#scs_alert").css("margin-top",-($("#scs_alert").height() /2) "px"); //세로 중앙에 위치하게 합니다.
$("#scs_alert").focus() //캐리지 리턴 후 함수를 실행할 수 없는 경우 포커스를 가져옵니다.
position(document .getElementById ('mask_layer'),0,0);
position(document.getElementById('scs_alert'),$(window).width()/2,$(window).height()/2);
if (typeof can == "number"){
//정기적으로 프롬프트 닫기
setTimeout(function(){
close_info();
},can*1000);
}
function close_info(){
//프롬프트 창 닫기
if(!c_){
$("#mask_layer").fadeOut("fast",function(){
$ ("#scs_alert").remove();
info();
if(typeof(ok)=="함수" )ok();
});
$("# verify_ok").click(function(){
close_info();
if(typeof(ok)=="function") ok();
});
$("#confirm_cancel ").click(function(){
> var code = e.which||event.keyCode;
if (code == 13 || code == 32){if (typeof(ok)=="function")ok()}
if ( code == 27){if(typeof(can)=="function")can()}
}
/ /Enter 및 ESC 키 바인딩
if (document.attachEvent)
문서 .attachEvent("onkeydown", modal_key);
else
document.addEventListener("keydown", modal_key, true) ;
}
//=========== ============================ 다음은 테스트 기능입니다 ================= =====================//
function test1(){
scscms_alert("기본 프롬프트 메시지");
}
function test2(){
scscms_alert("성공 프롬프트 메시지", "ok");
}
function test3() {
scscms_alert("성공 프롬프트 후 콜백 함수","ok" ,function(){alert("콜백이 성공했습니다! ")});
}
function test4(){
scscms_alert("실패 메시지","오류");
}
function test5(){
scscms_alert( " 실패 메시지","오류",function(){alert("아! 안돼!")});
}
function test6(){
scscms_alert("경고 메시지"," 경고") ;
}
function test7(){
scscms_alert("경고 메시지","warn",function(){alert("앗! 경고!")});
}
function test8(){
scscms_alert("이 정보 프롬프트가 마음에 드시나요?","confirm",function(){
scscms_alert("좋아요를 선택하셨습니다. 감사합니다!","ok" ;
scscms_alert("이 메시지는 3초 후에 자동으로 닫힙니다.","ok","",3);
}
function test10(){
scscms_alert("메시지를 닫도록 요청하세요. 정기적으로 3초 후에 자동으로 닫힙니다. 콜백 기능이 없습니다. ","confirm",function(){alert("Confirm callback!")},3);
}
script>