jquery eaayui 学习(三)tab

1.消息

$("#btn").click(function(){
		
		$.messager.defaults={ok:"确定",cancel:"取消"};      //更改默认显示文字
		
		$.messager.alert('Warning','The warning message');   //alert
		
		$.messager.confirm('Confirm','Are you sure you want to delete record?',function(r){
			alert(r);                         // true or false
		});
		
		$.messager.show({msg:'你的电脑将在10秒内重启。。。',title:'提示'});  //右下角弹出窗口
		
	});

2.tab页

(1)html代码:

<div  id="tt"  class="easyui-tabs"  style="width:200px;height:100px;">
		<div title="tab1">tab1</div>
		<div title="tab2" closable="true" iconCls="icon-reload" >tab2</div>
	</div>

(2)效果:

jquery eaayui 学习(三)tab

 (3)更多属性:

		$("#ttt").tabs({//编码方式创建tabs页并设置属性
			tools:[{            //右边按键, linkbutton数组
				text:'linkbutton',
				plain:true
			}],
			onSelect:function(title){  //选中事件
				//alert("tab '"+title+"' is selected.");
			}
		});
	});
	$("#btnAdd").click(function(){//添加新tab页
		$("#ttt").tabs("add",{
			title:'a new tab',
			content:'content of new tab',
			closable:true  
		});
	});
	$("#btn3").click(function(){//获取选中tab
		var pp = $("#ttt").tabs("getSelected");
		var tab = pp.panel("options").tab;// 怎么用??
		alert(tab.title);
	});

 

你可能感兴趣的:(jquery eaayui 学习(三)tab)