$('#btn1').click(function(){
artDialog({title:'图片查看', content:'<img width="817" height="479" src="http://www.hunanyishi.cn/images/main.jpg" />', fixed:true});
return false;
});
$('#btn2').click(function(){
artDialog({title:'google', url:'http://code.google.com/p/artdialog/', 640, height:320});//url参数其实就是iframe
return false;
});
$('#btn3').click(function(){
artDialog({title:'功夫兔', content:'<object width="420" height="363"><param name="movie" value="http://www.tudou.com/v/bXwe7XgTxuA"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque"></param><embed src="http://www.tudou.com/v/bXwe7XgTxuA" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="420" height="363"></embed></object>', fixed:true});
return false;
});
$('#btn4').click(function(){
artDialog({content:'你人品稳定么?', fixed:true, yesText:'我很稳定', style:'confirm'}, function(){alert('你是好人');}, function(){alert('你是坏人');});//style参数可以填写多个,用空格隔开。具体有什么请看皮肤css文件
return false;
});
$('#btn5').click(function(){
artDialog({content:'你是坏人', style:'alert', lock:true}, function(){});//lock参数就是锁屏,它会中断用户操作,用于显示非常重要的消息。慎用
return false;
});
$('#btn6').click(function(e){
//获取对象的坐标,让对话框在按钮附近弹出
var e = e || window.event,
_x,
_y;
if(e.pageX || e.pageY){
_x = e.pageX;
_y = e.pageY;
} else {
_x = e.clientX + document.body.clientLeft;
_y = e.clientY + Math.max(document.body.scrollTop, document.documentElement.scrollTop);
};
var _this = this;
artDialog({id:'menu_4834783',content:'<input style="200px;" id="M_dfd" type="text" value="hello world!" />',x:_x, y:_y, style:'noTitle noBorder'}, function(){ _this.innerHTML = $('M_dfd').value; });//使用id参数,可以防止点击弹出多个对话框
return false;
});
$('#btn7').click(function(){
artDialog({content:'您收到 <strong>2</strong> 条消息', x:'right', y:'bottom', time:'100', fixed:true});//x和y坐标可以使用关键字,当然也可以使用数字
return false;
});