重写alert
'+''+'');
if($.alerts.dialogClass)$("#popup_container").addClass($.alerts.dialogClass);
var pos=($.browser.msie&&parseInt($.browser.version) $("#popup_container").css({
position:pos,zIndex:99999,padding:0,margin:0
});
$("#popup_title").text(title);
$("#popup_content").addClass(type);
$("#popup_message").text(msg);
$("#popup_message").html($("#popup_message").text().replace(/\n/g,'
'));
$("#popup_container").css({
minWidth:$("#popup_container").outerWidth(),maxWidth:$("#popup_container").outerWidth()
});
$.alerts._reposition();
$.alerts._maintainPosition(true);
switch(type){
case'alert':$("#popup_message").after('');
$("#popup_ok").click(function(){
$.alerts._hide();
callback(true)
});
$("#popup_ok").focus().keypress(function(e){
if(e.keyCode==13||e.keyCode==27)$("#popup_ok").trigger('click')
});
break
};
if($.alerts.draggable){
try{
$("#popup_container").draggable({
handle:$("#popup_title")
});
$("#popup_title").css({
cursor:'move'
})
}
catch(e){}
}
}
,_hide:function(){
$("#popup_container").remove();
$.alerts._overlay('hide');
$.alerts._maintainPosition(false)
}
,_overlay:function(status){
switch(status){
case'show':$.alerts._overlay('hide');
$("BODY").append('');
$("#popup_overlay").css({
,左側:'0px',寬度:'100%' ,高度:$(文檔).height(),背景:$.alerts.overlayColor,不透明度:$.alerts.overlayOpacity
case'有隱藏':$(" #popup_over躺著").remove();
中斷
,_reposition:function(){
var top=(($(window).height()/ 2 ) - ( $("#popup_container").outerHeight() /2)) $.alerts.verticalOffset;
var left=(($(window).width()/ var left=(($(window).width()/ popup_container"). outerWidth() /2)) $.alerts.horizontalOffset;
🎜> if ($.browser.msie&&parseInt( $.browser.version) top:top ' px',left:left 'px'
});
🎜> ,_maintainPosition:函數(狀態){
如果($.alerts.repositionOnResize){
case true:$(window).bind('resize',function(){
_重新定位()
});
中斷中;
');
中斷中
}
};
jAlert=函數(訊息、標題、回呼){
$.alerts.alert(訊息、標題、回呼)
$.alerts.alert(訊息、標題、回呼)
}
$(function(){alert("hello word!")})
html>