Giter Site home page Giter Site logo

slickr's Introduction

Slickr

Slickr is a slicker and more simple flickr api from the ones I've seen in my admitedly short search for one. It's implemented as a jquery plugin, and based on jquery-flickr by Ryan Heath. Unlike that plugin though, it doesn't return jquery after an api call. After trying to use jquery-flickr, I realized that approach doesn't make any sense if you'd like to do something with the images you're fetching. They are fetched with an http call, which probably won't return by the time control is passed to the next call in the chain. Waiting for the http call to finish before handing off control is obviously unacceptable, so slickr just accepts a callback that is given jquery as an argument.

Usage

.slickr( method , options , [ callback ] );

Slickr trys to put as little as possible between you and the flickr api. It assumes the flickr method you're calling returns a set of photos and adds whatever it receives to the elements selected by jquery. They're added as children in a set of anchors containing images. It takes three arguments:

  • method the name of the method you'd like to call (a string), which corresponds directly to method names in the flickr api list.
  • options an object containing options for using slickr and the arguments for the method.
  • callback an optional callback function that's called after the fetched images have been added to the selected elements. It's given one argument, the selected elements.

As well as the required and optional arguments for a given method, you can specify two options for slickr itself. display_size specifies the size of the images that are added to the selected elements. It corresponds to flickr's usual size options and can be one of sq for square, t for thumbnail, s for small, m for medium. The default is medium. link_to_size specifies the size of the image that the images that are added to the selected elements link to. It can be one of the same values that I described for display_size. If link_to_size isn't specified, then the images will link to the main page for each image.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.