layui-js/test/element.html

190 lines
5.0 KiB
HTML
Raw Normal View History

2016-10-14 16:23:52 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>常用元素 - layui</title>
<link rel="stylesheet" href="../src/css/layui.css">
<style>
body{padding: 10px;}
</style>
</head>
<body>
2016-10-18 08:23:17 +08:00
<blockquote class="layui-elem-quote">Layui正是你苦苦寻找的前端UI框架</blockquote>
<blockquote class="layui-elem-quote layui-quote-nm">Layui正是你苦苦寻找的前端UI框架Layui正是你苦苦寻找的前端UI框架Layui正是你苦苦寻找的前端UI框架Layui正是你苦苦寻找的前端UI框架Layui正是你苦苦寻找的前端UI框架</blockquote>
<fieldset class="layui-elem-field">
<legend>字段集区块 - 默认风格</legend>
<div class="layui-field-box">
内容区域
</div>
</fieldset>
<fieldset class="layui-elem-field layui-field-title">
<legend>字段集区块 - 横线风格</legend>
</fieldset>
我们都是
<hr>
好孩子
2016-10-14 16:23:52 +08:00
<ul class="layui-nav">
<li class="layui-nav-item"><a href="">最新活动</a></li>
2016-11-18 15:03:44 +08:00
<li class="layui-nav-item layui-this">
<a href="">产品</a>
<dl class="layui-nav-child">
<dd><a href="">选项1</a></dd>
<dd><a href="">选项2</a></dd>
<dd><a href="">选项3</a></dd>
</dl>
</li>
2016-10-14 16:23:52 +08:00
<li class="layui-nav-item"><a href="">大数据</a></li>
2016-11-10 02:31:39 +08:00
<li class="layui-nav-item">
<a href="javascript:;">解决方案</a>
<dl class="layui-nav-child">
<dd><a href="">移动模块</a></dd>
2016-11-29 07:36:58 +08:00
<dd class="layui-this"><a href="">后台模版</a></dd>
2016-11-10 02:31:39 +08:00
<dd><a href="">电商平台</a></dd>
</dl>
</li>
2016-11-18 15:03:44 +08:00
<li class="layui-nav-item"><a href="">社区</a></li>
2016-10-14 16:23:52 +08:00
</ul>
<br><br>
2016-11-29 07:36:58 +08:00
<ul class="layui-nav layui-nav-tree" lay-filter="test">
<li class="layui-nav-item layui-nav-itemed">
2016-11-10 02:31:39 +08:00
<a class="" href="javascript:;">产品</a>
<dl class="layui-nav-child">
2016-11-29 07:36:58 +08:00
<dd><a href="javascript:;">移动模块</a></dd>
<dd><a href="javascript:;">后台模版</a></dd>
<dd><a href="javascript:;">电商平台</a></dd>
<dd><a href="">跳转菜单</a></dd>
2016-11-10 02:31:39 +08:00
</dl>
</li>
<li class="layui-nav-item">
<a href="javascript:;">解决方案</a>
<dl class="layui-nav-child">
<dd><a href="">移动模块</a></dd>
<dd><a href="">后台模版</a></dd>
<dd><a href="">电商平台</a></dd>
</dl>
</li>
2016-11-29 07:36:58 +08:00
<li class="layui-nav-item"><a href="">云市场</a></li>
2016-10-14 16:23:52 +08:00
<li class="layui-nav-item"><a href="">社区</a></li>
</ul>
<br><br>
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">国际新闻</a>
<a href="">亚太地区</a>
<a><cite>正文</cite></a>
</span>
<br><br>
<span class="layui-breadcrumb" lay-separator="|">
<a href="">娱乐</a>
<a href="">八卦</a>
<a href="">体育</a>
<a href="">搞笑</a>
<a href="">视频</a>
<a href="">游戏</a>
<a href="">综艺</a>
</span>
<br><br>
2016-11-29 07:36:58 +08:00
<div class="layui-tab" lay-filter="tabDemo" lay-allowClose="true">
2016-10-14 16:23:52 +08:00
<ul class="layui-tab-title">
<li class="layui-this">标题1</li>
<li>标题2</li>
<li>标题3</li>
<li>标题4</li>
<li>标题5</li>
</ul>
<div class="layui-tab-content">
2016-11-29 07:36:58 +08:00
<div class="layui-tab-item layui-show">1</div>
2016-10-14 16:23:52 +08:00
<div class="layui-tab-item">2</div>
<div class="layui-tab-item">3</div>
<div class="layui-tab-item">4</div>
<div class="layui-tab-item">5</div>
</div>
</div>
2016-11-29 07:36:58 +08:00
<button class="layui-btn" onclick="layui.element().tabChange('tabDemo', 2)">手工切换到第三项</button>
<button class="layui-btn" onclick="layui.element().tabAdd('tabDemo', {title:'新标题', content:'新内容'})">添加Tab</button>
<button class="layui-btn" onclick="layui.element().tabDelete('tabDemo', 3)">删除第四项</button>
2016-10-14 16:23:52 +08:00
<div class="layui-tab layui-tab-brief">
<ul class="layui-tab-title">
<li class="layui-this">标题1</li>
<li>标题2</li>
<li>标题3</li>
<li>标题4</li>
<li>标题5</li>
<li>标题6</li>
</ul>
</div>
<div class="layui-inline">
<div class="layui-tab layui-tab-card">
<ul class="layui-tab-title">
<li class="layui-this">标题1</li>
<li>标题2</li>
<li>标题3</li>
<li>标题4</li>
<li>标题5</li>
<li>标题6</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">1</div>
<div class="layui-tab-item">2</div>
<div class="layui-tab-item">3</div>
<div class="layui-tab-item">4</div>
<div class="layui-tab-item">5</div>
<div class="layui-tab-item">6</div>
</div>
</div>
</div>
2016-11-18 06:52:55 +08:00
<div class="layui-tab" lay-filter="test" lay-allowClose="true">
2016-10-14 16:23:52 +08:00
<ul class="layui-tab-title">
<li class="layui-this">标题1</li>
<li>标题2</li>
<li>标题3</li>
<li>标题4</li>
<li>标题5</li>
<li>标题6</li>
<li>标题7</li>
<li>标题8</li>
</ul>
</div>
<script src="../src/layui.js"></script>
<script>
layui.use('element', function(){
var element = layui.element();
element.on('tab(test)', function(data){
console.log(this, data);
});
2016-11-29 07:36:58 +08:00
element.on('nav(test)', function(elem){
console.log(elem)
});
2016-10-14 16:23:52 +08:00
});
</script>
</body>
</html>