|
1 |
| -# jQuery Image Gallery Plugin |
| 1 | +# jQuery Image Gallery |
2 | 2 |
|
3 |
| -## Notice |
4 |
| -[blueimp Gallery](http://blueimp.github.io/Gallery/) is a completely rewritten, much improved image gallery, replacing this version. |
| 3 | +- [Demo](#demo) |
| 4 | +- [Description](#description) |
| 5 | +- [Setup](#setup) |
| 6 | +- [Documentation](#documentation) |
| 7 | +- [Requirements](#requirements) |
| 8 | +- [License](#license) |
5 | 9 |
|
6 | 10 | ## Demo
|
7 | 11 | [jQuery Image Gallery Demo](http://blueimp.github.io/jQuery-Image-Gallery/)
|
8 | 12 |
|
9 |
| -## Description & Usage |
10 |
| -The Image Gallery plugin makes use of jQuery's |
11 |
| -[delegate](http://api.jquery.com/delegate/) method to attach |
12 |
| -a click event handler for all child elements of a container: |
| 13 | +## Description |
| 14 | +jQuery Image Gallery displays images with the touch-enabled, responsive and customizable [blueimp Gallery](http://blueimp.github.io/Gallery/) carousel in the dialog component of [jQuery UI](http://jqueryui.com/). |
| 15 | +It features swipe, mouse and keyboard navigation, transition effects and on-demand content loading and can be extended to display additional content types. |
13 | 16 |
|
14 |
| -```js |
15 |
| -$('#gallery').imagegallery(); |
16 |
| -``` |
17 |
| - |
18 |
| -It is possible to override the default selector as well as a number of |
19 |
| -additional gallery options: |
| 17 | +## Setup |
| 18 | +Copy **js/jquery.image-gallery.min.js** to your website. |
| 19 | + |
| 20 | +Add the following HTML snippet to the head section of your webpage: |
20 | 21 |
|
21 |
| -```js |
22 |
| -$('#gallery').imagegallery({ |
23 |
| - // selector given to jQuery's delegate method: |
24 |
| - selector: 'a[data-gallery="gallery"]', |
25 |
| - // event handler namespace: |
26 |
| - namespace: 'imagegallery', |
27 |
| - // Shows the next image after the given time in ms (0 = disabled): |
28 |
| - slideshow: 0, |
29 |
| - // Offset of image width to viewport width: |
30 |
| - offsetWidth: 100, |
31 |
| - // Offset of image height to viewport height: |
32 |
| - offsetHeight: 100, |
33 |
| - // Display images fullscreen (overrides offsets): |
34 |
| - fullscreen: false, |
35 |
| - // Display images as canvas elements: |
36 |
| - canvas: false, |
37 |
| - // body class added on dialog display: |
38 |
| - bodyClass: 'gallery-body', |
39 |
| - // element id of the loading animation: |
40 |
| - loaderId: 'gallery-loader', |
41 |
| - // list of available dialog effects, |
42 |
| - // used when show/hide is set to "random": |
43 |
| - effects: [ |
44 |
| - 'blind', |
45 |
| - 'clip', |
46 |
| - 'drop', |
47 |
| - 'explode', |
48 |
| - 'fade', |
49 |
| - 'fold', |
50 |
| - 'puff', |
51 |
| - 'slide', |
52 |
| - 'scale' |
53 |
| - ], |
54 |
| - // The following are jQuery UI dialog options, see |
55 |
| - // http://jqueryui.com/demos/dialog/#options |
56 |
| - // for additional options and documentation: |
57 |
| - modal: true, |
58 |
| - resizable: false, |
59 |
| - width: 'auto', |
60 |
| - height: 'auto', |
61 |
| - show: 'fade', |
62 |
| - hide: 'fade', |
63 |
| - dialogClass: 'gallery-dialog' |
64 |
| -}); |
| 22 | +```html |
| 23 | +<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/south-street/jquery-ui.css" id="theme"> |
| 24 | +<link rel="stylesheet" href="http://blueimp.github.io/Gallery/css/blueimp-gallery.min.css"> |
65 | 25 | ```
|
66 | 26 |
|
67 |
| -The click handler opens the linked images in a jQuery UI dialog. |
68 |
| -The options object given to the imagegallery method is passed to the |
69 |
| -[jQuery UI dialog](http://jqueryui.com/demos/dialog/) initialization |
70 |
| -and allows to override any |
71 |
| -[dialog options](http://jqueryui.com/demos/dialog/#options). |
| 27 | +Add the following HTML snippet with the dialog and embedded Gallery widget to the body of your webpage: |
72 | 28 |
|
73 |
| -It is possible to change options after widget initialization: |
| 29 | +```html |
| 30 | +<!-- The dialog widget --> |
| 31 | +<div id="blueimp-gallery-dialog" data-show="fade" data-hide="fade"> |
| 32 | + <!-- The gallery widget --> |
| 33 | + <div class="blueimp-gallery blueimp-gallery-carousel blueimp-gallery-controls"> |
| 34 | + <div class="slides"></div> |
| 35 | + <a class="prev">‹</a> |
| 36 | + <a class="next">›</a> |
| 37 | + <a class="play-pause"></a> |
| 38 | + </div> |
| 39 | +</div> |
| 40 | +``` |
74 | 41 |
|
75 |
| -```js |
76 |
| -$('#gallery').imagegallery('option', 'fullscreen', true); |
77 |
| -$('#gallery').imagegallery('option', { |
78 |
| - show: 'slide', |
79 |
| - hide: 'slide' |
80 |
| -}); |
| 42 | +Include the following scripts at the bottom of the body of your webpage: |
| 43 | + |
| 44 | +```html |
| 45 | +<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> |
| 46 | +<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> |
| 47 | +<script src="http://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script> |
| 48 | +<script src="js/jquery.image-gallery.min.js"></script> |
81 | 49 | ```
|
82 | 50 |
|
83 |
| -The Image Gallery widget can also be disabled/enabled/destroyed: |
| 51 | +Create a list of links to image files with the attribute **data-dialog** (optionally with enclosed thumbnails) and add them to the body of your webpage: |
84 | 52 |
|
85 |
| -```js |
86 |
| -$('#gallery').imagegallery('disable'); |
87 |
| -$('#gallery').imagegallery('enable'); |
88 |
| -$('#gallery').imagegallery('destroy'); |
| 53 | +```html |
| 54 | +<div id="links"> |
| 55 | + <a href="images/banana.jpg" title="Banana" data-dialog> |
| 56 | + <img src="images/thumbnails/banana.jpg" alt="Banana"> |
| 57 | + </a> |
| 58 | + <a href="images/apple.jpg" title="Apple" data-dialog> |
| 59 | + <img src="images/thumbnails/apple.jpg" alt="Apple"> |
| 60 | + </a> |
| 61 | + <a href="images/orange.jpg" title="Orange" data-dialog> |
| 62 | + <img src="images/thumbnails/orange.jpg" alt="Orange"> |
| 63 | + </a> |
| 64 | +</div> |
89 | 65 | ```
|
90 | 66 |
|
| 67 | +## Documentation |
| 68 | +For information regarding Keyboard shortcuts, Gallery Options, API methods, Video Gallery setup, Gallery extensions and Browser support, please refer to the [blueimp Gallery documentation](https://github.com/blueimp/Gallery/blob/master/README.md). |
| 69 | + |
91 | 70 | ## Requirements
|
92 |
| -* [jQuery](http://jquery.com/) v. 1.6+ |
93 |
| -* [jQuery UI](http://jqueryui.com/) v. 1.8+ (Required: Widget, Dialog) |
94 |
| -* [JavaScript Load Image](https://github.com/blueimp/JavaScript-Load-Image) v. 1.7+ (included) |
| 71 | +* [jQuery](http://jquery.com/) v. 1.7.0+ |
| 72 | +* [jQuery UI](http://jqueryui.com/) v. 1.10.0+ |
| 73 | +* [blueimp Gallery](https://github.com/blueimp/Gallery) v. 2.12.0+ |
95 | 74 |
|
96 | 75 | ## License
|
97 | 76 | Released under the [MIT license](http://www.opensource.org/licenses/MIT).
|
0 commit comments