迷途知返
Report bugs
最简单的调用方式:
$.msgbox("hello, world!");
提示:可修改部分代码后运行
设定高度和宽度:
$.msgbox({ closeIcon: 'Close', // closeIcon: {type:'image', content:'close.gif'} height:500, width:600, content:'Hello, world!' // content:{type:'text', content:'Hello, world!'} });
提示:可修改部分代码后运行
警告框:
$.msgbox({ content:{type:'alert', content:'Warning'}, animation:0,//禁止拖拽 drag:false,//禁止动画 autoClose: 10 //自动关闭 });
提示:可修改部分代码后运行
确认框:
$.msgbox({ height:150, width:250, content:{type:'confirm', content: 'Hello, world?'}, onClose:function(v){ if(v) alert("You've clicked 'Yes' button!"); else alert("You've clicked 'No' button or closed me!"); } });
提示:可修改部分代码后运行
输入框:
$mb = $.msgbox({ height:500, width:600, content:{type:'input', content:'Input: '}, title: 'Input', onInputed: function(v){alert('You inputed:'+v)} // or you can get the value by $mb.value somewhere else });
提示:可修改部分代码后运行
关闭事件:
$.msgbox({ height:500, width:600, content:'Hello, world!', onClose: function(){alert('You。。。have closed me!')} });
提示:可修改部分代码后运行
Ajax:
$.msgbox({ height:500, width:600, content:{type:'ajax', content:'demo_ajax.htm'}, title: 'Ajax example', onAjaxed: function(data){alert(data)} });
提示:可修改部分代码后运行
iframe:(从外部操作msgbox)
$mb = $.msgbox({ height:500, width:600, content:{type:'iframe',content:'demo_iframe.htm'}, title: 'Public functions', closeIcon:{type:'icon',content:'close.gif'} });
提示:可修改部分代码后运行