-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
99 lines (80 loc) · 3.03 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<html>
<head>
<meta charset="utf-8" />
<title>Test</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script type="text/javascript" src="dynatab.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/css/normalize.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/css/foundation.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/js/vendor/modernizr.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/js/foundation.min.js"></script>
<style media="screen" type="text/css">
.tab-action__close{
padding: 0 !important;
margin-right: 5px;
line-height: 3.6;
}
.tab-title{
background-color: #EFEFEF;
}
.tab-title.active{
background-color: white;
}
ul[role="tablist"] li{
border: 1px solid blue;
}
</style>
<script type="text/javascript">
$(function() {
document.getElementById('#generateTab1').onclick = function (){
dynatab.ajaxType = 'GET';
dynatab.prefixIdTab = 'css';
dynatab.contentId = 'content-search-css';
dynatab.callback = function(){alert('Click done!')};
var idGenerated = Math.round(Math.random() * (9999 - 1) + 1);
dynatab.createTab(
'list__table1',
'content__table1',
'Text tab ' + idGenerated,
'ajax.php',
{
"prefix": dynatab.prefixIdTab,
"id-tab-section": idGenerated
}
);
}
document.getElementById('#generateTab2').onclick = function (){
dynatab.ajaxType = 'GET';
dynatab.prefixIdTab = 'css';
dynatab.contentId = 'content-search-css';
dynatab.callback = function(){};
var idGenerated = Math.round(Math.random() * (9999 - 1) + 1);
dynatab.createTab(
'list__table2',
'content__table2',
'Text tab ' + idGenerated,
'ajax.php',
{
"prefix": dynatab.prefixIdTab,
"id-tab-section": idGenerated
}
);
}
});
</script>
</head>
<body>
<div id="content-search-css">
<input type="button" value="Generate one tab" id="#generateTab1"/>
<ul class="tabs list__table1" data-tab role="tablist">
</ul>
<div class="tabs-content content__table1">
</div>
<input type="button" value="Generate one tab" id="#generateTab2"/>
<ul class="tabs list__table2" data-tab role="tablist">
</ul>
<div class="tabs-content content__table2">
</div>
</div>
</body>
</html>