forked from joshreed/jQuery-ScrollTabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
documentation.html
169 lines (132 loc) · 5.31 KB
/
documentation.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html>
<head>
<title>jQuery ScrollTabs :: Josh Reed</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="examples/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="examples/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/scrolltabs.css">
<link rel="stylesheet" href="examples/css/demo.css">
</head>
<body>
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<a class="navbar-brand" href="index.html">jQuery ScrollTabs</a>
<ul class="nav navbar-nav navbar-right">
<li><a href="index.html">Download</a></li>
<li><a href="index.html#examples">Examples</a></li>
<li><a href="#">Documentation</a></li>
</ul>
</div>
</div>
<!--
<div class="colored_header">
<div class="container"</div>
<h1 style="border-bottom: 1px dotted #CCCCFF;">Too Many Tabs in Your Tabbed Interface? Scroll 'Em!</h1>
<h3>Customizable. Free. Dynamic.</h3>
<div>You can make it your own by using simple CSS</div>
</div>
</div>
-->
<div class="container">
<a name="examples"></a>
<h1>Documentation</h1>
<h2>Available Options</h2>
<p><code>scroll_distance</code> - Pixel width distance for each scroll click. Default: 300 pixels.</p>
<br />
<p><code>scroll_duration</code> - Animation time for scrolling in milliseconds. Default: 300 milliseconds.</p>
<br />
<p><code>left_arrow_size</code> - Pixel width for the scroll button on the left side. Default: 26 pixels</p>
<br />
<p><code>right_arrow_size</code> - Pixel width for the scroll button on the right side. Default 26 pixels.</p>
<br />
<p><code>click_callback</code> - Callback function on click. Accpets the click event object as an argument.
The default callback function will change the page to the href in the 'rel' attribute of the item's span tag.</p>
<br />
<h3>Usage</h3>
<pre>
$('#tabSet').scrollTabs({
scroll_distance: 350,
scroll_duration: 350,
left_arrow_size: 26,
right_arrow_size: 26,
click_callback: function(e){
var val = $(this).attr('rel');
if(val){
window.location.href = val;
}
}
});</pre>
<h2>API</h2>
<p>The returned object will have the following methods.</p>
<pre>
var tabSet = $('#tab_set').scrollTabs();
tabSet.addTab('<span>Hi</span>');</pre>
<br />
<p>
<strong><code>domObject</code></strong> - Access the DOM Object that this TabSet was created on.
</p>
<br />
<p>
<strong><code>addTab(html, position)</code></strong> - Add a tab to the ScrollTabs interface.
The new tab is created from the HTML string that you pass to this method. Providing an HTML
string provides you with the full flexibility to augment your span tag fully to meet the needs
of your specific use-case. Optionally, you may pass a position value, which if not provided
will default to placing the new tab as the last tab. The positions are zero-indexed, and the
new tab will shift all items at and past the indicated position down one item.
</p>
<pre>
// Place a new tab into the first position
tabSet.addTab('<span>Hi</span>', 0);</pre>
<br />
<p>
<strong><code>removeTabs(jQuerySelector)</code></strong> - Removes all the items that are
returned by the jQuery selector string (scoped within this object).
</p>
<pre>
// Remove the span with a specific ID
tabSet.removeTabs('#tab_id');
// Remove the first span, a couple of options
tabSet.removeTabs('span:eq(0)');
tabSet.removeTabs('span:nth-child(1)');</pre>
<br />
<p>
<strong><code>clearTabs()</code></strong> - Removes all the items in this ScrollTabs object.
</p>
<br />
<p>
<strong><code>destroy()</code></strong> - Destroys the ScrollTabs instance formatting, leaving
only the raw HTML contents. This is effectively the opposite of the ScrollTabs initialization.
</p>
<br />
<p>
<strong><code>hideTabs(jQuerySelector)</code></strong> - Hide tabs based on the jQuery Selector.
This is for situations where you may not want to completely remove a tab, but want to temporarily hide it.
</p>
<br />
<p>
<strong><code>showTabs(jQuerySelector)</code></strong> - Shows hidden tabs based on the jQuery Selector.
</p>
</div>
<div class="footer">
© Copyright 2014 Josh Reed<br />
Created in Association with <a href='http://www.mosaik.com'>Mosaik Solutions</a><br />
Software is released under the MIT License
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="examples/js/bootstrap.min.js"></script>
<script src="js/jquery.scrolltabs.js"></script>
<script src="js/jquery.mousewheel.js"></script>
<script type="text/javascript">
var tabs3 = null;
$(document).ready(function(){
$('#tabs1').scrollTabs();
$('#tabs2').scrollTabs();
tabs3 = $('#tabs3').scrollTabs();
});
</script>
</body>
</html>