Skip to content

Instantly share code, notes, and snippets.

@tatey
Forked from ThisIsMissEm/gist:296524
Created February 7, 2010 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatey/297142 to your computer and use it in GitHub Desktop.
Save tatey/297142 to your computer and use it in GitHub Desktop.
// Set API Key
var flickr = $.flickr('123');
// Request instance by invoking flickr service method
var recent = flickr.photos.getRecent({
size: 's'
page: 1,
beforeSend: function() {
$('img#waiting').fadeIn();
},
success: function(thumbnails) {
$('img#waiting').fadeOut();
$('#photos').append(thumbnails);
}
});
// Request methods
recent.hasNext(); // >>> true # Next page?
recent.next(); // >>> Void # Gets the next page
recent.hasPrev(); // >>> true # Previous page?
recent.prev(); // >>> Void # Gets the previous page
recent.pageCount(); // >>> 50 # Total number of pages
recent.page() // >>> 2 # Current page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment