多种类型自定义对话框插件jDialog是一款基于jquery实现的轻量级多种类型的自定义对话框插件

在项目开发中、一般会美化 alert(); 的样式、那么今天我就和大家分享一款非常炫的插件

先来看一下程序最后的效果图片吧

炫酷JQUERY自定义对话框插件JDIALOG_JDIALOG弹出对话框和确认对话框插件

下面是HTMl代码

 

<center>
<button id="test1">alert方式调用</button>
<br/><br/>
<button id="test2">confirm方式调用</button>
<br/><br/>
<button id="test3">iframe方式调用</button>
<br/><br/>
<button id="test4">只显示内容对话框</button>
<br/><br/>
<button id="test5">对话框配置按钮</button>
<br/><br/>
<button id="test6">message方式调用</button>
<br/><br/>
<button id="test7">tip方式调用</button>
</center>

以下是JS代码

 

 

$("#test1").click(function(){
	var dialog = jDialog.alert(´欢迎使用jDialog组件,我是alert!´,{},{
	showShadow: false,// 不显示对话框阴影
	buttonAlign : ´center´,
	events : {
		show : function(evt){
			var dlg = evt.data.dialog;
		},
		close : function(evt){
			var dlg = evt.data.dialog;
		},
		enterKey : function(evt){
			alertenter key pressed!´);
		},
		escKey : function(evt){
			alertesc key pressed!´);
			evt.data.dialog.close();
		}
	}
  });
}) ; 

$("#test2").click(function(){
	var dialog = jDialog.confirm(´欢迎使用jDialog组件,我是confirm!´,{
		handler : function(button,dialog) {
			alert(´你点击了确定!´);
			dialog.close();
		}
	},{
		handler : function(button,dialog) {
			alert(´你点击了取消!´);
			dialog.close();
		}
	});
});

$("#test3").click(function(){
	// 通过options参数,控制iframe对话框
	var dialog = jDialog.iframehttp://dwtedx.com/´,{
		title : ´代码编辑器 - dwtedx个人博客´,
		width : 1100,
		height : 550
	});
});

$("#test4").click(function(){
	// 通过options参数,控制dialog
	var dialog = jDialog.dialog({
		title : ´自定义对话框´,
		content 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2021-07-09
  • 2021-11-14
猜你喜欢
  • 2021-12-28
  • 2021-11-23
  • 2021-07-27
  • 2021-12-30
  • 2021-07-23
  • 2022-12-23
相关资源
相似解决方案