easyUI入门《十一、linkbutton基础:按钮》

<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>Insert title here</title>
		<!--引入基本库-->
		<script type="text/javascript" src="jquery-easyui-1.5.5.4/jquery.min.js"></script>
		<script type="text/javascript" src="jquery-easyui-1.5.5.4/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="jquery-easyui-1.5.5.4/locale/easyui-lang-zh_CN.js"></script>
		<link rel="stylesheet" href="jquery-easyui-1.5.5.4/themes/default/easyui.css" />
		<link rel="stylesheet" href="jquery-easyui-1.5.5.4/themes/icon.css" />
	</head>

	<body>
		<!--
			按钮跳转href:href="remote.html"
			按钮默认选中:selected:true
			按钮选中与不选择切换:toggle:true
			按钮图标位置:iconAlign:'right'
			按钮简单形式:plain:true
			按钮多选一:group:'g1',toggle:true
		-->
		<div>基础菜单</div>
		<a href="tree.html" class="easyui-linkbutton">text</a>
		<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',selected:true">icon</a>
		<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-large-clipart',iconAlign:'left'">icon</a>
		<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-large-clipart',iconAlign:'left',size:'large'">icon</a>
		<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-large-clipart',iconAlign:'top',toggle:true">icon</a>
		<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-large-clipart',iconAlign:'top',toggle:true,plain:true">icon</a>

		<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',group:'g1',toggle:true">icon1</a>
		<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',group:'g1',toggle:true">icon2</a>
		<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',group:'g1',toggle:true">icon3</a>

		<!--
			菜单弹出对齐方式:menuAlign:'right'
			按钮什么情况弹出菜单:easyui-splitbutton
						   easyui-menubutton
		-->
		<br /><br />
		<div>菜单按钮</div>
		<a href="tree.html" class="easyui-menubutton" data-options="iconCls:'icon-add',menu:'#mm1'">Add</a>
		<a href="tree.html" class="easyui-menubutton" data-options="iconCls:'icon-help',menu:'#mm2',menuAlign:'left'">Help</a>
		<a href="tree.html" class="easyui-splitbutton" data-options="iconCls:'icon-help',menu:'#mm3',menuAlign:'right'">Help2</a>
		<div id="mm1" class="easyui-menu" style="width: 120px;">
			<div>New</div>
			<div>Save</div>
			<div>Exit</div>
		</div>
		<div id="mm2" class="easyui-menu" style="width: 120px;">
			<div data-options="iconCls:'icon-add',name:'new'">New</div>
			<div data-options="iconCls:'icon-save',name:'save'">Saveqqqqqqqqqq</div>
			<div data-options="name:'exit'">Exit</div>
		</div>
		<div id="mm3" class="easyui-menu" style="width: 120px;">
			<div data-options="iconCls:'icon-add',name:'new'">New</div>
			<div data-options="iconCls:'icon-save',name:'save'">Saveqqqqqqqqqq</div>
			<div data-options="name:'exit'">Exit</div>
		</div>

		<br /><br />
		<div>选项卡嵌套按钮</div>
		<div style="margin:20px 0;"></div>
		<div id="tt" style="width:700px;height:250px">
			<div title="About" style="padding:10px">

			</div>
			<div title="My Documents" style="padding:10px">
				<ul class="easyui-tree" data-options="url:'tree_data1.json',method:'get',animate:true"></ul>
			</div>
			<div title="Help" style="padding:10px">
				This is the help content.
			</div>
		</div>
		<div id="mm">
			<div>Welcome</div>
			<div>Help Contents</div>
			<div data-options="iconCls:'icon-search'">Search</div>
			<div>Dynamic Help</div>
		</div>

		<script>
			$(function() {
				var p = $('#tt').tabs().tabs('tabs')[2];
				var mb = p.panel('options').tab.find('a.tabs-inner');
				mb.menubutton({
					menu: '#mm',
					iconCls: 'icon-help'
				}).click(function() {
					$('#tt').tabs('select', 2);
				});
			});
		</script>

		<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
		<p>基础弹框</p>
		<a href="#" class="easyui-linkbutton" onclick="show()">Show</a>
		<script type="text/javascript">
			function show() {
				$.messager.show({
					title: 'My title',
					msg: 'this is message',
					showType: 'show'
				})
			}
		</script>

		<a href="#" class="easyui-linkbutton" onclick="slide()">Slide</a>
		<script type="text/javascript">
			function slide() {
				$.messager.show({
					title: 'My title',
					msg: 'this is message',
					showType: 'slide',
					timeout: 5000
				})
			}
		</script>

		<a href="#" class="easyui-linkbutton" onclick="fade()">fade</a>
		<script type="text/javascript">
			function fade() {
				$.messager.show({
					title: 'My title',
					msg: 'this is message',
					showType: 'fade'
				})
			}
		</script>

		<a href="#" class="easyui-linkbutton" onclick="progress()">progress</a>
		<script type="text/javascript">
			function progress() {
				$.messager.progress({
					title: 'progress哈哈哈',
					msg: 'loading...哈哈哈',
				});
				setTimeout(function() {
					$.messager.progress("close")
				}, 3000)
			}
		</script>
		
		
		<p>位置弹框</p>
				<p>
			<a href="#" class="easyui-linkbutton" onclick="topLeft()">topLeft</a>
		</p>
		<script type="text/javascript">
			function topLeft(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show',
					style:{
						right:"",
						left:0,
						top:document.body.scrollTop+document.documentElement.scrollTop,
						bottom:""
					}
				})
			}
		</script>
		
		<p>
			<a href="#" class="easyui-linkbutton" onclick="topCenter()">topCenter</a>
		</p>
		<script type="text/javascript">
			function topCenter(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show',
					style:{
						right:"",
						//left:0,
						top:document.body.scrollTop+document.documentElement.scrollTop,
						bottom:""
					}
				})
			}
		</script>
		
		<p>
			<a href="#" class="easyui-linkbutton" onclick="topRight()">topRight</a>
		</p>
		<script type="text/javascript">
			function topRight(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show',
					style:{
						right:0,
						left:'',
						top:document.body.scrollTop+document.documentElement.scrollTop,
						bottom:""
					}
				})
			}
		</script>
		
		
		<p>
			<a href="#" class="easyui-linkbutton" onclick="centerLeft()">centerLeft</a>
		</p>
		<script type="text/javascript">
			function centerLeft(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show',
					style:{
						right:"",
						left:0,
						//top:document.body.scrollTop+document.documentElement.scrollTop,
						//bottom:""
					}
				})
			}
		</script>
		
		<p>
			<a href="#" class="easyui-linkbutton" onclick="centerRight()">centerRight</a>
		</p>
		<script type="text/javascript">
			function centerRight(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show',
					style:{
						right:0,
						left:"",
//						top:document.body.scrollTop+document.documentElement.scrollTop,
//						bottom:""
					}
				})
			}
		</script>
		
		<p>
			<a href="#" class="easyui-linkbutton" onclick="center()">center</a>
		</p>
		<script type="text/javascript">
			function center(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show',
					style:{
//						right:0,
//						left:'',
//						top:document.body.scrollTop+document.documentElement.scrollTop,
//						bottom:""
					}
				})
			}
		</script>
		
		
		<p>
			<a href="#" class="easyui-linkbutton" onclick="bottomLeft()">bottomLeft</a>
		</p>
		<script type="text/javascript">
			function bottomLeft(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show',
					style:{
						right:"",
						left:0,
						top:"",
						bottom:document.body.scrollTop-document.documentElement.scrollTop
					}
				})
			}
		</script>
		
		<p>
			<a href="#" class="easyui-linkbutton" onclick="bottomRight()">bottomRight</a>
		</p>
		<script type="text/javascript">
			function bottomRight(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show'
				})
			}
		</script>
		
		<p>
			<a href="#" class="easyui-linkbutton" onclick="bottomCenter()">bottomCenter</a>
		</p>
		<script type="text/javascript">
			function bottomCenter(){
				$.messager.show({
					title:'My title',
					msg:'this is message',
					showType:'show',
					style:{
//						right:"",
//						left:"",
						top:"",
						bottom:document.body.scrollTop-document.documentElement.scrollTop
					}
				})
			}
		</script>
		
		
		<br /><br /><br /><br /><br /><br /><br /><br />
		<!--
			alert
			confirm
			prompt
		-->
		<p>交互联系框</p>
		<p>注意函数名,不要调用了系统的函数</p>
		<a class="easyui-linkbutton" onclick="myalert()">alert</a>
		<a class="easyui-linkbutton" onclick="myconfirm()">myconfirm</a>
		<a class="easyui-linkbutton" onclick="myprompt()">myprompt</a>
		<script type="text/javascript">
			function myalert(){
//				$.messager.alert("title","context","info");
//				$.messager.alert("title","context","error");
//				$.messager.alert("title","context","question");
				$.messager.alert("title","context","warning");
			}
			function myconfirm(){
				$.messager.confirm("title","context",function(r){
					alert(r)
				});
			}
			function myprompt(){
				$.messager.prompt("title","context",function(r){
					if (r){
						alert('you type: '+r);
					}
				});
			}
			
		</script>

	</body>

</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值