<!DOCTYPE html>
<html lang="ch">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello world!</title>
<link href="lib/css/zui.min.css" rel="stylesheet">
<link href="lib/datatable/zui.datatable.min.css" rel="stylesheet">
</head>
<body>
<table id="tab" class="datatable" data-checkable="true" data-sortable="true"></table>
<button class="btn btn-primary" type="button" id="btn_click">
主要1按钮
</button>
<button class="btn btn-primary" type="button" id="btn_click2">
主要2按钮
</button>
<script>
$('#btn_click').click(function () {
/* 使用选项选项来初始化数据 */
$('table.datatable').datatable({
data: {
cols: [
{width: 80, text: '#', type: 'number', flex: false, colClass: 'text-center'},
{width: 160, text: '时间', type: 'date', flex: false, sort: 'down'},
{width: 80, text: '名称', type: 'string', flex: true, colClass: ''}
],
rows: [
{checked: false, data: [1, '2016-01-18 11:05:15', '名称示例1']},
{checked: false, data: [2, '2016-01-20 12:06:16', '名称示例2']},
// 更多数据
]
}
})
})
$('#btn_click2').click(function () {
// 使用data参数更新数据:
$('table.datatable').datatable('load', {
cols: [
{width: 80, text: '新的#', type: 'number', flex: false, colClass: 'text-center'},
{width: 160, text: '新的时间', type: 'date', flex: false, sort: 'down'},
{width: 80, text: '新的名称', type: 'string', flex: true, colClass: ''}
],
rows: [
{checked: false, data: [1, '2016-01-18 11:09:36', '新的名称示例1']},
{checked: false, data: [2, '2016-01-22 12:06:16', '新的名称示例2']},
// 更多数据
]
})
})
</script>
</body>
</html>
</code>
<figure data-class="imagezui1" class="image image-zui-1 opacity1 imagezui1 actived" style="animation-duration: 2s transition: all 2s ease 0s"></figure>用了css3的两个属性animation-duration,transition
你可以学习一下,看看怎么用