@k37z3r/jbase 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/README.md +59 -43
- package/dist/browser.d.ts +5 -6
- package/dist/browser.d.ts.map +1 -1
- package/dist/core.d.ts +9 -14
- package/dist/core.d.ts.map +1 -1
- package/dist/index.cjs +577 -452
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +304 -603
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +575 -452
- package/dist/index.mjs.map +7 -0
- package/dist/jbase.browser.js +338 -281
- package/dist/jbase.browser.js.map +7 -0
- package/dist/jbase.min.js +3 -2
- package/dist/jbase.min.js.map +7 -0
- package/dist/modules/css/classes.d.ts +15 -29
- package/dist/modules/css/classes.d.ts.map +1 -1
- package/dist/modules/css/index.d.ts +5 -9
- package/dist/modules/css/index.d.ts.map +1 -1
- package/dist/modules/css/styles.d.ts +7 -13
- package/dist/modules/css/styles.d.ts.map +1 -1
- package/dist/modules/data/arrays.d.ts +96 -64
- package/dist/modules/data/arrays.d.ts.map +1 -1
- package/dist/modules/data/index.d.ts +5 -9
- package/dist/modules/data/index.d.ts.map +1 -1
- package/dist/modules/data/objects.d.ts +86 -54
- package/dist/modules/data/objects.d.ts.map +1 -1
- package/dist/modules/data/types.d.ts +3 -22
- package/dist/modules/data/types.d.ts.map +1 -1
- package/dist/modules/dom/attributes.d.ts +10 -19
- package/dist/modules/dom/attributes.d.ts.map +1 -1
- package/dist/modules/dom/content.d.ts +9 -17
- package/dist/modules/dom/content.d.ts.map +1 -1
- package/dist/modules/dom/index.d.ts +8 -15
- package/dist/modules/dom/index.d.ts.map +1 -1
- package/dist/modules/dom/manipulation.d.ts +41 -81
- package/dist/modules/dom/manipulation.d.ts.map +1 -1
- package/dist/modules/dom/states.d.ts +12 -23
- package/dist/modules/dom/states.d.ts.map +1 -1
- package/dist/modules/dom/traversal.d.ts +64 -127
- package/dist/modules/dom/traversal.d.ts.map +1 -1
- package/dist/modules/effects/fade.d.ts +13 -31
- package/dist/modules/effects/fade.d.ts.map +1 -1
- package/dist/modules/effects/index.d.ts +15 -23
- package/dist/modules/effects/index.d.ts.map +1 -1
- package/dist/modules/effects/slide.d.ts +13 -31
- package/dist/modules/effects/slide.d.ts.map +1 -1
- package/dist/modules/effects/types.d.ts +33 -0
- package/dist/modules/effects/types.d.ts.map +1 -0
- package/dist/modules/effects/vertical.d.ts +13 -31
- package/dist/modules/effects/vertical.d.ts.map +1 -1
- package/dist/modules/events/binding.d.ts +11 -21
- package/dist/modules/events/binding.d.ts.map +1 -1
- package/dist/modules/events/form.d.ts +18 -35
- package/dist/modules/events/form.d.ts.map +1 -1
- package/dist/modules/events/index.d.ts +9 -17
- package/dist/modules/events/index.d.ts.map +1 -1
- package/dist/modules/events/keyboard.d.ts +16 -31
- package/dist/modules/events/keyboard.d.ts.map +1 -1
- package/dist/modules/events/lifecycle.d.ts +6 -11
- package/dist/modules/events/lifecycle.d.ts.map +1 -1
- package/dist/modules/events/mouse.d.ts +30 -59
- package/dist/modules/events/mouse.d.ts.map +1 -1
- package/dist/modules/events/touch.d.ts +15 -29
- package/dist/modules/events/touch.d.ts.map +1 -1
- package/dist/modules/http/get.d.ts +18 -25
- package/dist/modules/http/get.d.ts.map +1 -1
- package/dist/modules/http/index.d.ts +11 -15
- package/dist/modules/http/index.d.ts.map +1 -1
- package/dist/modules/http/post.d.ts +13 -19
- package/dist/modules/http/post.d.ts.map +1 -1
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +2246 -0
- package/dist/server.js.map +7 -0
- package/dist/types.d.ts +11 -21
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +20 -23
- package/dist/utils.d.ts.map +1 -1
- package/package.json +14 -4
- package/wiki/CSS-Classes-&-Styles.md +128 -0
- package/wiki/DATA-Utilities-(Arrays).md +332 -0
- package/wiki/DATA-Utilities-(Objects).md +263 -0
- package/wiki/DOM-Attributes.md +56 -0
- package/wiki/DOM-Content.md +48 -0
- package/wiki/DOM-Manipulation.md +272 -0
- package/wiki/DOM-States.md +73 -0
- package/wiki/DOM-Traversal.md +529 -0
- package/wiki/EFFECTS-Fade.md +76 -0
- package/wiki/EFFECTS-Slide-(horizontal).md +70 -0
- package/wiki/EFFECTS-Slide-(vertical).md +75 -0
- package/wiki/EVENTS-Bindings.md +55 -0
- package/wiki/EVENTS-Form.md +122 -0
- package/wiki/EVENTS-Keyboard.md +98 -0
- package/wiki/EVENTS-Lifecycle.md +25 -0
- package/wiki/EVENTS-Mouse.md +218 -0
- package/wiki/EVENTS-Touch.md +98 -0
- package/wiki/HTTP-Requests.md +93 -0
- package/wiki/Home.md +118 -0
- package/wiki/Installation.md +44 -0
- package/wiki/Quick-Start.md +139 -0
- package/dist/browser.js +0 -29
- package/dist/browser.js.map +0 -1
- package/dist/core.js +0 -78
- package/dist/core.js.map +0 -1
- package/dist/index.js +0 -100
- package/dist/index.js.map +0 -1
- package/dist/jbase.js +0 -1898
- package/dist/modules/css/classes.js +0 -88
- package/dist/modules/css/classes.js.map +0 -1
- package/dist/modules/css/index.js +0 -33
- package/dist/modules/css/index.js.map +0 -1
- package/dist/modules/css/styles.js +0 -49
- package/dist/modules/css/styles.js.map +0 -1
- package/dist/modules/data/arrays.js +0 -177
- package/dist/modules/data/arrays.js.map +0 -1
- package/dist/modules/data/index.js +0 -33
- package/dist/modules/data/index.js.map +0 -1
- package/dist/modules/data/objects.js +0 -168
- package/dist/modules/data/objects.js.map +0 -1
- package/dist/modules/data/types.js +0 -43
- package/dist/modules/data/types.js.map +0 -1
- package/dist/modules/dom/attributes.js +0 -69
- package/dist/modules/dom/attributes.js.map +0 -1
- package/dist/modules/dom/content.js +0 -63
- package/dist/modules/dom/content.js.map +0 -1
- package/dist/modules/dom/index.js +0 -48
- package/dist/modules/dom/index.js.map +0 -1
- package/dist/modules/dom/manipulation.js +0 -343
- package/dist/modules/dom/manipulation.js.map +0 -1
- package/dist/modules/dom/states.js +0 -89
- package/dist/modules/dom/states.js.map +0 -1
- package/dist/modules/dom/traversal.js +0 -527
- package/dist/modules/dom/traversal.js.map +0 -1
- package/dist/modules/effects/fade.js +0 -104
- package/dist/modules/effects/fade.js.map +0 -1
- package/dist/modules/effects/index.js +0 -38
- package/dist/modules/effects/index.js.map +0 -1
- package/dist/modules/effects/slide.js +0 -103
- package/dist/modules/effects/slide.js.map +0 -1
- package/dist/modules/effects/vertical.js +0 -118
- package/dist/modules/effects/vertical.js.map +0 -1
- package/dist/modules/events/binding.js +0 -60
- package/dist/modules/events/binding.js.map +0 -1
- package/dist/modules/events/form.js +0 -106
- package/dist/modules/events/form.js.map +0 -1
- package/dist/modules/events/index.js +0 -53
- package/dist/modules/events/index.js.map +0 -1
- package/dist/modules/events/keyboard.js +0 -83
- package/dist/modules/events/keyboard.js.map +0 -1
- package/dist/modules/events/lifecycle.js +0 -40
- package/dist/modules/events/lifecycle.js.map +0 -1
- package/dist/modules/events/mouse.js +0 -172
- package/dist/modules/events/mouse.js.map +0 -1
- package/dist/modules/events/touch.js +0 -74
- package/dist/modules/events/touch.js.map +0 -1
- package/dist/modules/http/get.js +0 -65
- package/dist/modules/http/get.js.map +0 -1
- package/dist/modules/http/index.js +0 -42
- package/dist/modules/http/index.js.map +0 -1
- package/dist/modules/http/post.js +0 -54
- package/dist/modules/http/post.js.map +0 -1
- package/dist/types.js +0 -15
- package/dist/types.js.map +0 -1
- package/dist/utils.js +0 -71
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
* [`closest`](#usage-closest) | [`parent`](#usage-parent) | [`children`](#usage-children) | [`findAll`](#usage-findAll)
|
|
2
|
+
* [`descendants`](#usage-descendants) | [`parents`](#usage-parents) | [`parentsUntil`](#usage-parentsUntil)
|
|
3
|
+
* [`descendantsUntil`](#usage-descendantsUntil)
|
|
4
|
+
* [`next`](#usage-next) | [`prev`](#usage-prev) | [`nextSibling`](#usage-nextSibling) | [`prevSibling`](#usage-prevSibling)
|
|
5
|
+
* [`sibling`](#usage-sibling) | [`nextAll`](#usage-nextAll) | [`prevAll`](#usage-prevAll) | [`siblings`](#usage-siblings)
|
|
6
|
+
* [`nextUntil`](#usage-nextUntil) | [`prevUntil`](#usage-prevUntil)
|
|
7
|
+
* [`eq`](#usage-eq) | [`first`](#usage-first) | [`last`](#usage-last) | [`filterBy`](#usage-filterBy) | [`not`](#usage-not)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## <a id="usage-closest"></a>.closest
|
|
12
|
+
|
|
13
|
+
**Description**
|
|
14
|
+
Travels up the DOM tree from the current element to find the first ancestor that matches the selector.
|
|
15
|
+
|
|
16
|
+
**Parameters**
|
|
17
|
+
|
|
18
|
+
* `selector` (String): A string containing a selector expression to match elements against.
|
|
19
|
+
|
|
20
|
+
**Returns**
|
|
21
|
+
|
|
22
|
+
* (jBase): A new jBase object containing the matching ancestor.
|
|
23
|
+
|
|
24
|
+
**Example**
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
// Find the nearest container div for a button
|
|
28
|
+
const container = $('button.save').closest('.container');
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## <a id="usage-parent"></a>.parent
|
|
35
|
+
|
|
36
|
+
**Description**
|
|
37
|
+
Get the direct parent of each element in the current set of matched elements.
|
|
38
|
+
|
|
39
|
+
**Parameters**
|
|
40
|
+
|
|
41
|
+
* None.
|
|
42
|
+
|
|
43
|
+
**Returns**
|
|
44
|
+
|
|
45
|
+
* (jBase): The parent elements.
|
|
46
|
+
|
|
47
|
+
**Example**
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
$('.item').parent().addClass('has-items');
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## <a id="usage-children"></a>.children
|
|
57
|
+
|
|
58
|
+
**Description**
|
|
59
|
+
Get the children of each element in the set of matched elements, optionally filtered by a selector.
|
|
60
|
+
|
|
61
|
+
**Parameters**
|
|
62
|
+
|
|
63
|
+
* `selector` (String, optional): A string containing a selector expression to match elements against.
|
|
64
|
+
|
|
65
|
+
**Returns**
|
|
66
|
+
|
|
67
|
+
* (jBase): The children elements.
|
|
68
|
+
|
|
69
|
+
**Example**
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
// Get only list items with class 'active'
|
|
73
|
+
$('ul.menu').children('li.active');
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## <a id="usage-findAll"></a>.findAll
|
|
80
|
+
|
|
81
|
+
**Description**
|
|
82
|
+
Finds all descendant elements that match the selector. This is an alias for `find()`.
|
|
83
|
+
|
|
84
|
+
**Parameters**
|
|
85
|
+
|
|
86
|
+
* `selector` (String): The selector to match.
|
|
87
|
+
|
|
88
|
+
**Returns**
|
|
89
|
+
|
|
90
|
+
* (jBase): The found elements.
|
|
91
|
+
|
|
92
|
+
**Example**
|
|
93
|
+
|
|
94
|
+
```javascript
|
|
95
|
+
// Find all spans inside the header
|
|
96
|
+
$('.header').findAll('span');
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## <a id="usage-descendants"></a>.descendants
|
|
103
|
+
|
|
104
|
+
**Description**
|
|
105
|
+
Get all descendant elements (children, grandchildren, etc.), optionally filtered by a selector.
|
|
106
|
+
|
|
107
|
+
**Parameters**
|
|
108
|
+
|
|
109
|
+
* `selector` (String, optional): Filter for the descendants.
|
|
110
|
+
|
|
111
|
+
**Returns**
|
|
112
|
+
|
|
113
|
+
* (jBase): All descendant elements.
|
|
114
|
+
|
|
115
|
+
**Example**
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
$('#tree').descendants('.leaf');
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## <a id="usage-parents"></a>.parents
|
|
125
|
+
|
|
126
|
+
**Description**
|
|
127
|
+
Get the ancestors of each element in the current set of matched elements.
|
|
128
|
+
|
|
129
|
+
**Parameters**
|
|
130
|
+
|
|
131
|
+
* `selector` (String, optional): If supplied, the ancestors are filtered.
|
|
132
|
+
|
|
133
|
+
**Returns**
|
|
134
|
+
|
|
135
|
+
* (jBase): The ancestor elements.
|
|
136
|
+
|
|
137
|
+
**Example**
|
|
138
|
+
|
|
139
|
+
```javascript
|
|
140
|
+
$('span').parents('div');
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## <a id="usage-parentsUntil"></a>.parentsUntil
|
|
147
|
+
|
|
148
|
+
**Description**
|
|
149
|
+
Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector.
|
|
150
|
+
|
|
151
|
+
**Parameters**
|
|
152
|
+
|
|
153
|
+
* `selector` (String): The selector that indicates where to stop matching ancestor elements.
|
|
154
|
+
* `filter` (String, optional): A string containing a selector expression to filter the returned ancestors.
|
|
155
|
+
|
|
156
|
+
**Returns**
|
|
157
|
+
|
|
158
|
+
* (jBase): The ancestor elements between the current element and the stop selector.
|
|
159
|
+
|
|
160
|
+
**Example**
|
|
161
|
+
|
|
162
|
+
```javascript
|
|
163
|
+
// Get all parents of .item until .container is reached
|
|
164
|
+
$('.item').parentsUntil('.container');
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## <a id="usage-descendantsUntil"></a>.descendantsUntil
|
|
171
|
+
|
|
172
|
+
**Description**
|
|
173
|
+
Get all descendant elements, but stop searching deeper in a specific branch once the provided selector is matched.
|
|
174
|
+
|
|
175
|
+
**Parameters**
|
|
176
|
+
|
|
177
|
+
* `selector` (String): The selector that indicates where to stop the deep traversal.
|
|
178
|
+
|
|
179
|
+
**Returns**
|
|
180
|
+
|
|
181
|
+
* (jBase): The descendant elements found before hitting the stop selector.
|
|
182
|
+
|
|
183
|
+
**Example**
|
|
184
|
+
|
|
185
|
+
```javascript
|
|
186
|
+
// Find descendants but don't look inside nested .protected-areas
|
|
187
|
+
$('.root').descendantsUntil('.protected-area');
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## <a id="usage-next"></a>.next
|
|
194
|
+
|
|
195
|
+
**Description**
|
|
196
|
+
Get the immediately following sibling of each element in the set of matched elements.
|
|
197
|
+
|
|
198
|
+
**Parameters**
|
|
199
|
+
|
|
200
|
+
* `selector` (String, optional): If supplied, the method only returns the element if it matches.
|
|
201
|
+
|
|
202
|
+
**Returns**
|
|
203
|
+
|
|
204
|
+
* (jBase): The next sibling.
|
|
205
|
+
|
|
206
|
+
**Example**
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
$('.current-step').next().addClass('next-step');
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## <a id="usage-prev"></a>.prev
|
|
216
|
+
|
|
217
|
+
**Description**
|
|
218
|
+
Get the immediately preceding sibling of each element in the set of matched elements.
|
|
219
|
+
|
|
220
|
+
**Parameters**
|
|
221
|
+
|
|
222
|
+
* `selector` (String, optional): If supplied, the method only returns the element if it matches.
|
|
223
|
+
|
|
224
|
+
**Returns**
|
|
225
|
+
|
|
226
|
+
* (jBase): The previous sibling.
|
|
227
|
+
|
|
228
|
+
**Example**
|
|
229
|
+
|
|
230
|
+
```javascript
|
|
231
|
+
$('.step-2').prev();
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## <a id="usage-nextSibling"></a>.nextSibling
|
|
238
|
+
|
|
239
|
+
**Description**
|
|
240
|
+
Get the immediately following DOM sibling element. Unlike `next()`, this focuses strictly on the DOM structure `nextElementSibling`.
|
|
241
|
+
|
|
242
|
+
**Parameters**
|
|
243
|
+
|
|
244
|
+
* None.
|
|
245
|
+
|
|
246
|
+
**Returns**
|
|
247
|
+
|
|
248
|
+
* (jBase): The next sibling element.
|
|
249
|
+
|
|
250
|
+
**Example**
|
|
251
|
+
|
|
252
|
+
```javascript
|
|
253
|
+
const nextEl = $('.current').nextSibling();
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## <a id="usage-prevSibling"></a>.prevSibling
|
|
260
|
+
|
|
261
|
+
**Description**
|
|
262
|
+
Get the immediately preceding DOM sibling element. Unlike `prev()`, this focuses strictly on the DOM structure `previousElementSibling`.
|
|
263
|
+
|
|
264
|
+
**Parameters**
|
|
265
|
+
|
|
266
|
+
* None.
|
|
267
|
+
|
|
268
|
+
**Returns**
|
|
269
|
+
|
|
270
|
+
* (jBase): The previous sibling element.
|
|
271
|
+
|
|
272
|
+
**Example**
|
|
273
|
+
|
|
274
|
+
```javascript
|
|
275
|
+
const prevEl = $('.current').prevSibling();
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## <a id="usage-sibling"></a>.sibling
|
|
282
|
+
|
|
283
|
+
**Description**
|
|
284
|
+
Get a single, specific sibling element. Unlike `siblings()` which returns all siblings, this method returns a specific one (e.g. the immediate next or matching a specific condition depending on implementation).
|
|
285
|
+
*(Note: Based on typical usage, this often acts like a directed `next` or `prev` or finds a specific single neighbor).*
|
|
286
|
+
|
|
287
|
+
**Parameters**
|
|
288
|
+
|
|
289
|
+
* `selector` (String, optional): A selector to identify the specific sibling.
|
|
290
|
+
|
|
291
|
+
**Returns**
|
|
292
|
+
|
|
293
|
+
* (jBase): The specific sibling element.
|
|
294
|
+
|
|
295
|
+
**Example**
|
|
296
|
+
|
|
297
|
+
```javascript
|
|
298
|
+
// Get a specific sibling with class 'active'
|
|
299
|
+
$('.item').sibling('.active');
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## <a id="usage-nextAll"></a>.nextAll
|
|
306
|
+
|
|
307
|
+
**Description**
|
|
308
|
+
Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
|
|
309
|
+
|
|
310
|
+
**Parameters**
|
|
311
|
+
|
|
312
|
+
* `selector` (String, optional): A string containing a selector expression to match elements against.
|
|
313
|
+
|
|
314
|
+
**Returns**
|
|
315
|
+
|
|
316
|
+
* (jBase): All following sibling elements.
|
|
317
|
+
|
|
318
|
+
**Example**
|
|
319
|
+
|
|
320
|
+
```javascript
|
|
321
|
+
// Select all elements coming after the active one
|
|
322
|
+
$('.active').nextAll();
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## <a id="usage-prevAll"></a>.prevAll
|
|
329
|
+
|
|
330
|
+
**Description**
|
|
331
|
+
Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
|
|
332
|
+
|
|
333
|
+
**Parameters**
|
|
334
|
+
|
|
335
|
+
* `selector` (String, optional): A string containing a selector expression to match elements against.
|
|
336
|
+
|
|
337
|
+
**Returns**
|
|
338
|
+
|
|
339
|
+
* (jBase): All preceding sibling elements.
|
|
340
|
+
|
|
341
|
+
**Example**
|
|
342
|
+
|
|
343
|
+
```javascript
|
|
344
|
+
// Select all elements coming before the active one
|
|
345
|
+
$('.active').prevAll();
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## <a id="usage-siblings"></a>.siblings
|
|
352
|
+
|
|
353
|
+
**Description**
|
|
354
|
+
Get the siblings of each element in the set of matched elements.
|
|
355
|
+
|
|
356
|
+
**Parameters**
|
|
357
|
+
|
|
358
|
+
* `selector` (String, optional): If supplied, the siblings are filtered.
|
|
359
|
+
|
|
360
|
+
**Returns**
|
|
361
|
+
|
|
362
|
+
* (jBase): The sibling elements.
|
|
363
|
+
|
|
364
|
+
**Example**
|
|
365
|
+
|
|
366
|
+
```javascript
|
|
367
|
+
// Find all siblings that are not active
|
|
368
|
+
$('.active').siblings(':not(.active)');
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## <a id="usage-nextUntil"></a>.nextUntil
|
|
375
|
+
|
|
376
|
+
**Description**
|
|
377
|
+
Get all following siblings of each element up to but not including the element matched by the selector.
|
|
378
|
+
|
|
379
|
+
**Parameters**
|
|
380
|
+
|
|
381
|
+
* `selector` (String): The selector that indicates where to stop matching following sibling elements.
|
|
382
|
+
* `filter` (String, optional): A selector to filter the returned siblings.
|
|
383
|
+
|
|
384
|
+
**Returns**
|
|
385
|
+
|
|
386
|
+
* (jBase): The following siblings up to the stop selector.
|
|
387
|
+
|
|
388
|
+
**Example**
|
|
389
|
+
|
|
390
|
+
```javascript
|
|
391
|
+
// Select all elements between header and footer
|
|
392
|
+
$('#header').nextUntil('#footer');
|
|
393
|
+
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## <a id="usage-prevUntil"></a>.prevUntil
|
|
399
|
+
|
|
400
|
+
**Description**
|
|
401
|
+
Get all preceding siblings of each element up to but not including the element matched by the selector.
|
|
402
|
+
|
|
403
|
+
**Parameters**
|
|
404
|
+
|
|
405
|
+
* `selector` (String): The selector that indicates where to stop matching preceding sibling elements.
|
|
406
|
+
* `filter` (String, optional): A selector to filter the returned siblings.
|
|
407
|
+
|
|
408
|
+
**Returns**
|
|
409
|
+
|
|
410
|
+
* (jBase): The preceding siblings up to the stop selector.
|
|
411
|
+
|
|
412
|
+
**Example**
|
|
413
|
+
|
|
414
|
+
```javascript
|
|
415
|
+
// Select all items backwards until the start marker
|
|
416
|
+
$('.end-marker').prevUntil('.start-marker');
|
|
417
|
+
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## <a id="usage-eq"></a>.eq
|
|
423
|
+
|
|
424
|
+
**Description**
|
|
425
|
+
Reduce the set of matched elements to the one at the specified index.
|
|
426
|
+
|
|
427
|
+
**Parameters**
|
|
428
|
+
|
|
429
|
+
* `index` (Number): An integer indicating the 0-based position of the element.
|
|
430
|
+
|
|
431
|
+
**Returns**
|
|
432
|
+
|
|
433
|
+
* (jBase): The element at the index.
|
|
434
|
+
|
|
435
|
+
**Example**
|
|
436
|
+
|
|
437
|
+
```javascript
|
|
438
|
+
// Select the 3rd element (index 2)
|
|
439
|
+
$('li').eq(2).css('color', 'red');
|
|
440
|
+
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
## <a id="usage-first"></a>.first
|
|
446
|
+
|
|
447
|
+
**Description**
|
|
448
|
+
Reduce the set of matched elements to the first in the set.
|
|
449
|
+
|
|
450
|
+
**Parameters**
|
|
451
|
+
|
|
452
|
+
* None.
|
|
453
|
+
|
|
454
|
+
**Returns**
|
|
455
|
+
|
|
456
|
+
* (jBase): The first element.
|
|
457
|
+
|
|
458
|
+
**Example**
|
|
459
|
+
|
|
460
|
+
```javascript
|
|
461
|
+
$('p').first();
|
|
462
|
+
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## <a id="usage-last"></a>.last
|
|
468
|
+
|
|
469
|
+
**Description**
|
|
470
|
+
Reduce the set of matched elements to the final one in the set.
|
|
471
|
+
|
|
472
|
+
**Parameters**
|
|
473
|
+
|
|
474
|
+
* None.
|
|
475
|
+
|
|
476
|
+
**Returns**
|
|
477
|
+
|
|
478
|
+
* (jBase): The last element.
|
|
479
|
+
|
|
480
|
+
**Example**
|
|
481
|
+
|
|
482
|
+
```javascript
|
|
483
|
+
$('p').last();
|
|
484
|
+
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
## <a id="usage-filterBy"></a>.filterBy
|
|
490
|
+
|
|
491
|
+
**Description**
|
|
492
|
+
Reduce the set of matched elements to those that match the selector.
|
|
493
|
+
|
|
494
|
+
**Parameters**
|
|
495
|
+
|
|
496
|
+
* `selector` (String): The selector to match.
|
|
497
|
+
|
|
498
|
+
**Returns**
|
|
499
|
+
|
|
500
|
+
* (jBase): The filtered subset.
|
|
501
|
+
|
|
502
|
+
**Example**
|
|
503
|
+
|
|
504
|
+
```javascript
|
|
505
|
+
$('div').filterBy('.highlight');
|
|
506
|
+
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## <a id="usage-not"></a>.not
|
|
512
|
+
|
|
513
|
+
**Description**
|
|
514
|
+
Remove elements from the set of matched elements.
|
|
515
|
+
|
|
516
|
+
**Parameters**
|
|
517
|
+
|
|
518
|
+
* `selector` (String): A string containing a selector expression to match elements against.
|
|
519
|
+
|
|
520
|
+
**Returns**
|
|
521
|
+
|
|
522
|
+
* (jBase): The subset without the matched elements.
|
|
523
|
+
|
|
524
|
+
**Example**
|
|
525
|
+
|
|
526
|
+
```javascript
|
|
527
|
+
$('input').not('[type="submit"]');
|
|
528
|
+
|
|
529
|
+
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
* [`fadeIn`](#usage-fadeIn) | [`fadeOut`](#usage-fadeOut) | [`fadeToggle`](#usage-fadeToggle)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## <a id="usage-fadeIn"></a>.fadeIn
|
|
6
|
+
|
|
7
|
+
**Description**
|
|
8
|
+
Display the matched elements by fading them to opaque (opacity: 1).
|
|
9
|
+
|
|
10
|
+
**Parameters**
|
|
11
|
+
|
|
12
|
+
* `duration` (Number, optional): A number determining how long the animation will run (in milliseconds). Default is usually 400.
|
|
13
|
+
* `callback` (Function, optional): A function to call once the animation is complete.
|
|
14
|
+
|
|
15
|
+
**Returns**
|
|
16
|
+
|
|
17
|
+
* (jBase): Current instance.
|
|
18
|
+
|
|
19
|
+
**Example**
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
// Fade in all hidden paragraphs over 600ms
|
|
23
|
+
$('p.hidden').fadeIn(600, function() {
|
|
24
|
+
console.log('Animation complete.');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## <a id="usage-fadeOut"></a>.fadeOut
|
|
32
|
+
|
|
33
|
+
**Description**
|
|
34
|
+
Hide the matched elements by fading them to transparent (opacity: 0). Once complete, the display property is often set to 'none'.
|
|
35
|
+
|
|
36
|
+
**Parameters**
|
|
37
|
+
|
|
38
|
+
* `duration` (Number, optional): Duration in milliseconds.
|
|
39
|
+
* `callback` (Function, optional): A function to call once the animation is complete.
|
|
40
|
+
|
|
41
|
+
**Returns**
|
|
42
|
+
|
|
43
|
+
* (jBase): Current instance.
|
|
44
|
+
|
|
45
|
+
**Example**
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
$('.alert-box').fadeOut(300);
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## <a id="usage-fadeToggle"></a>.fadeToggle
|
|
55
|
+
|
|
56
|
+
**Description**
|
|
57
|
+
Display or hide the matched elements by animating their opacity.
|
|
58
|
+
|
|
59
|
+
**Parameters**
|
|
60
|
+
|
|
61
|
+
* `duration` (Number, optional): Duration in milliseconds.
|
|
62
|
+
* `callback` (Function, optional): A function to call once the animation is complete.
|
|
63
|
+
|
|
64
|
+
**Returns**
|
|
65
|
+
|
|
66
|
+
* (jBase): Current instance.
|
|
67
|
+
|
|
68
|
+
**Example**
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
// Toggle visibility on click
|
|
72
|
+
$('#toggle-btn').click(() => {
|
|
73
|
+
$('.content').fadeToggle();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
* [`slideIn`](#usage-slideIn) | [`slideOut`](#usage-slideOut) | [`slideToggle`](#usage-slideToggle)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## <a id="usage-slideIn"></a>.slideIn
|
|
6
|
+
|
|
7
|
+
**Description**
|
|
8
|
+
Displays the matched elements with a sliding motion (usually from left to right or by expanding width).
|
|
9
|
+
|
|
10
|
+
**Parameters**
|
|
11
|
+
|
|
12
|
+
* `duration` (Number, optional): Duration in milliseconds.
|
|
13
|
+
* `callback` (Function, optional): A function to call once the animation is complete.
|
|
14
|
+
|
|
15
|
+
**Returns**
|
|
16
|
+
|
|
17
|
+
* (jBase): Current instance.
|
|
18
|
+
|
|
19
|
+
**Example**
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
$('#sidebar').slideIn(400);
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## <a id="usage-slideOut"></a>.slideOut
|
|
29
|
+
|
|
30
|
+
**Description**
|
|
31
|
+
Hides the matched elements with a sliding motion (usually collapsing width or moving off-canvas).
|
|
32
|
+
|
|
33
|
+
**Parameters**
|
|
34
|
+
|
|
35
|
+
* `duration` (Number, optional): Duration in milliseconds.
|
|
36
|
+
* `callback` (Function, optional): A function to call once the animation is complete.
|
|
37
|
+
|
|
38
|
+
**Returns**
|
|
39
|
+
|
|
40
|
+
* (jBase): Current instance.
|
|
41
|
+
|
|
42
|
+
**Example**
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
$('#sidebar').slideOut(400);
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## <a id="usage-slideToggle"></a>.slideToggle
|
|
52
|
+
|
|
53
|
+
**Description**
|
|
54
|
+
Display or hide the matched elements with a horizontal sliding motion.
|
|
55
|
+
|
|
56
|
+
**Parameters**
|
|
57
|
+
|
|
58
|
+
* `duration` (Number, optional): Duration in milliseconds.
|
|
59
|
+
* `callback` (Function, optional): A function to call once the animation is complete.
|
|
60
|
+
|
|
61
|
+
**Returns**
|
|
62
|
+
|
|
63
|
+
* (jBase): Current instance.
|
|
64
|
+
|
|
65
|
+
**Example**
|
|
66
|
+
|
|
67
|
+
```javascript
|
|
68
|
+
$('.drawer').slideToggle();
|
|
69
|
+
|
|
70
|
+
```
|