-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathajax-tabs.html
91 lines (74 loc) · 2.6 KB
/
ajax-tabs.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
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Ajax Tabs</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Bootstrap -->
<link href="../css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div id="test"></div>
<ul class="nav nav-tabs" data-tab-content="#myTabContent">
<!-- TODO remove firstTab id -->
<!-- <li><a id="firstTab" href="ajax.php?page=1" data-toggle="ajax-tab" data-target="#page1">Page 1</a></li>
<li><a href="ajax.php?page=2" data-toggle="ajax-tab" data-target="#page2">Page 2</a></li>
<li><a href="ajax.php?page=3" data-toggle="ajax-tab">Page 3</a></li>-->
<!-- <li><a id="firstTab" href="ajax.php?page=1" data-toggle="ajax-tab">Page 1</a></li>-->
<li><a id="firstTab" href="#page1" data-toggle="ajax-tab">Page 1</a></li>
<li><a href="ajax.php?page=2" data-toggle="ajax-tab">Page 2</a></li>
<li><a href="ajax.php?page=3" data-toggle="ajax-tab">Page 3</a></li>
<!-- <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#dropdown1" data-toggle="tab">@fat</a></li>
<li><a href="#dropdown2" data-toggle="tab">@mdo</a></li>
</ul>
</li>-->
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="page1">
Page 1 preloaded
</div>
<!-- <div class="tab-pane fade in active" id="page1">
</div>
<div class="tab-pane fade" id="page2">
</div>
<div class="tab-pane fade" id="page3">
</div>-->
</div>
<a href="ajax.php?page=2" id="altLnkToTab2" data-target="#myTabContent > div:eq(1)">Alternative link to tab 2</a>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="bootstrap.min.js"></script>
<script src="../src/bootstrap-tab.js"></script>
<script>
var log = console.log;
$(function() {
window.firstTab = $('#firstTab');
//$('[data-toggle="ajax-tab"]').ajaxTab('option', 'cacheResponse', false)
$('#altLnkToTab2').click(function(e) {
e.preventDefault();
//$(this).ajaxTab('option', 'ajaxCompleteCallback', 'a');
$(this).ajaxTab('show');
})
})
//$(function() {
// $('.nav-tabs a').click(function(e) {
// e.preventDefault();
// log('here');
// })
//
// $('[data-toggle="tab"]').on('show', function (e) {
// e.preventDefault();
// log('showing');
// });
//
//// $('[data-toggle="ajax-tab"]').bind('show', function(e) {
//// log('showing');
//// })
//})
</script>
<script src="bootstrap-ajax-tabs.js"></script>
<!--<script src="bak/crossfade--bootstrap-ajax-tabs.js"></script>-->
</body>
</html>