q4.flickrGallery
Fetches and displays photo albums from a user on Flickr.- Script link
- q4.flickrgallery.1.0.2.min.js
- Source file
- q4.flickrgallery.js, line 2
- Requires
Examples
$("#gallery").flickrGallery({ apiKey: 'abcdef1234567890', userId: '11111111@N01', perPage: 100, albums: ['First Photo Album', 'Second Photo Album'] });
Options
- apiKey string
-
A Flickr API key.
- userId string
-
A Flickr user ID.
- albums Array.<string>
-
An array of photo album names to fetch.
If the list is empty (default), fetch all photo albums.
- perPage number
-
The maximum number of photos to fetch from each album.
This can be up to 500.
- Default value
500
- template
-
A mustache.js template for all photo albums.
An album has these tags:
- `{{albumID}}`
- `{{albumTitle}}`
- `{{albumDesc}}`
- `{{photoCount}}`
- `{{#photos}}`: An array of photos in this album.
Each photo has these tags:
- `{{photoID}}`
- `{{photoTitle}}`
- `{{photoDesc}}`
- `{{photoIndex}}`
- `{{url}}`: URLs for each size (e.g. `{{url.Medium}}`).
Valid sizes:
- `Square` 75 x 75
- `LargeSquare` 150 x 150
- `Thumbnail` 100 x 75
- `Small` 240 x 180
- `Small320` 320 x 240
- `Medium` 500 x 375
- `Medium640` 640 x 480
- `Medium800` 800 x 600
- `Large` 1024 x 768
- `Original` 2400 x 1800
- Example
'{{#albums}}' + '<h3>{{albumTitle}}</h3>' + '<ul class="album">' + '{{#photos}}' + '<li class="col-xs-4 col-sm-3 col-md-2 col-lg-2">' + '<a class="fancybox" rel="fncbx" title="{{photoTitle}}" href="{{photoUrl}}">' + '<img src="{{thumbUrl}}" alt="{{photoTitle}}">' + '<span class="title">{{photoTitle}}</span>' + '</a>' + '</li>' + '{{/photos}}' + '</ul>' + '{{/albums}}'
- beforeRender function
-
A callback fired before items are are passed to into the template
- Parameters
- event Event
- The event object.
- object object
- albums object.
- complete function
-
A callback fired when rendering is completed.
- Parameters
- event Event
- The event object.