You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

10
10
11
11
## Demo
12
12
13
-
You can find a simple demo on [the Documentation page](http://mobify.github.io/bellows). More demos can be found inside the `examples` folder in the repo.
13
+
You can find a simple demo on [the Documentation page](http://mobify.github.io/bellows). More demos can be found inside the `examples` folder in the repo. Run `grunt examples` to see them in Chrome (mobile device emulation is recommended).
If you are using Zepto, you need to load `bower_components/velocity/velocity.js` (this file comes with a jQuery shim bundled directly in it). If you are using jQuery, you need to load `bower_components/velocity/jquery.velocity.js`.
23
-
24
-
### jQuery Support
25
-
26
-
Bellows supports jQuery but is not actively developed for it. You should be able to use Bellows directly with jQuery 2.0. While we don't actively support jQuery for Bellows, we welcome any and all issues and PRs to help us make it work.
22
+
Bellows supports Zepto up until v5.1.2 but is not actively developed for it. While we don't actively support Zepto for Bellows, we welcome any and all issues and PRs to help us make it work.
27
23
28
24
29
25
## Installation
30
26
31
-
Bellows can be installed using bower:
27
+
Bellows can be installed using NPM:
32
28
33
29
```
34
-
bower install bellows
30
+
npm install bellows-ui
35
31
```
36
32
37
33
## Usage with Require.js
38
34
39
-
To use with require.js, after installing through bower you merely have to reference bellows in your require config file:
35
+
To use with require.js, after installing through NPM you merely have to reference bellows in your require config file (**Note**: If your project already has these external dependencies, and the versions are compatible, it's recommended that you use the one in your project to reduce duplication):
Sets the easing for the animation. Bellows takes all of the same easing properties that [Velocity.js](http://julian.com/research/velocity) accepts.
175
172
176
-
> *[jQuery UI's easings](http://easings.net/) and CSS3's easings ("ease", "ease-in", "ease-out", and "ease-in-out"), which are pre-packaged into Velocity. A bonus "spring" easing (sampled in the CSS Support pane) is also included.
177
-
* CSS3's bezier curves: Pass in a four-item array of bezier points. (Refer to [Cubic-Bezier.com](http://cubic-bezier.com/) for crafing custom bezier curves.)
178
-
* Spring physics: Pass a two-item array in the form of [ tension, friction ]. A higher tension (default: 600) increases total speed and bounciness. A lower friction (default: 20) increases ending vibration speed.
179
-
* Step easing: Pass a one-item array in the form of [ steps ]. The animation will jump toward its end values using the specified number of steps.
173
+
> *[jQuery UI's easings](http://easings.net/) and CSS3's easings ("ease", "ease-in", "ease-out", and "ease-in-out"), which are pre-packaged into Velocity. A bonus "spring" easing (sampled in the CSS Support pane) is also included.
174
+
* CSS3's bezier curves: Pass in a four-item array of bezier points. (Refer to [Cubic-Bezier.com](http://cubic-bezier.com/) for crafing custom bezier curves.)
175
+
* Spring physics: Pass a two-item array in the form of [ tension, friction ]. A higher tension (default: 600) increases total speed and bounciness. A lower friction (default: 20) increases ending vibration speed.
176
+
* Step easing: Pass a one-item array in the form of [ steps ]. The animation will jump toward its end values using the specified number of steps.
180
177
181
178
For more information, check out [Velocity's docs on easing](http://julian.com/research/velocity/#easing).
182
179
@@ -197,11 +194,11 @@ Triggered every time the selected bellows item is starting to open.
197
194
| Parameter name | Description |
198
195
|----------------|-------------|
199
196
|**e**| An Event object passed to the callback |
200
-
|**ui**| An object containing any associated data for use inside the callback |
197
+
|**ui**| An object containing any associated data for use inside the callback |
201
198
202
199
```js
203
200
$('.bellows').bellows({
204
-
open:function(e, ui) {
201
+
open:function(e, ui) {
205
202
// ui.item contains the item opening
206
203
}
207
204
});
@@ -218,11 +215,11 @@ Triggered every time the selected bellows item has finished opening.
218
215
| Parameter name | Description |
219
216
|----------------|-------------|
220
217
|**e**| An Event object passed to the callback |
221
-
|**ui**| An object containing any associated data for use inside the callback |
218
+
|**ui**| An object containing any associated data for use inside the callback |
222
219
223
220
```js
224
221
$('.bellows').bellows({
225
-
opened:function(e, ui) {
222
+
opened:function(e, ui) {
226
223
// ui.item contains the item that opened
227
224
}
228
225
});
@@ -237,11 +234,11 @@ Triggered every time an bellows item is starting to close.
237
234
| Parameter name | Description |
238
235
|----------------|-------------|
239
236
|**e**| An Event object passed to the callback |
240
-
|**ui**| An object containing any associated data for use inside the callback |
237
+
|**ui**| An object containing any associated data for use inside the callback |
241
238
242
239
```js
243
240
$('.bellows').bellows({
244
-
close:function(e, ui) {
241
+
close:function(e, ui) {
245
242
// ui.item contains the item closing
246
243
}
247
244
});
@@ -256,11 +253,11 @@ Triggered every time an bellows item is finished closing.
256
253
| Parameter name | Description |
257
254
|----------------|-------------|
258
255
|**e**| An Event object passed to the callback |
259
-
|**ui**| An object containing any associated data for use inside the callback |
256
+
|**ui**| An object containing any associated data for use inside the callback |
260
257
261
258
```js
262
259
$('.bellows').bellows({
263
-
closed:function(e, ui) {
260
+
closed:function(e, ui) {
264
261
// ui.item contains the item that closed
265
262
}
266
263
});
@@ -291,7 +288,7 @@ $bellows.bellows('openAll');
291
288
```
292
289
293
290
### close
294
-
291
+
295
292
Close the selected bellows item by element reference
296
293
297
294
```js
@@ -313,7 +310,7 @@ $bellows.bellows('closeAll');
313
310
```
314
311
315
312
### toggle
316
-
313
+
317
314
Toggle the selected bellows item by element reference
318
315
319
316
```js
@@ -363,7 +360,7 @@ $('.bellows').bellows({
363
360
});
364
361
```
365
362
366
-
This will scroll the viewport to the opened bellows item, restoring its position in the viewport.
363
+
This will scroll the viewport to the opened bellows item, restoring its position in the viewport.
367
364
368
365
## Browser Compatibility
369
366
@@ -379,19 +376,16 @@ This will scroll the viewport to the opened bellows item, restoring its position
The `dist` directory will be populated with minified versions of the css and javascript files for distribution and use with whatever build system you might use. The `src` directory has our raw unminified Sass and Javascript files if you prefer to work with those.
0 commit comments