Team:University College London/fbphotosbytudelft

From 2012.igem.org

(Difference between revisions)
Line 65: Line 65:
   var html = '';
   var html = '';
   for(j=0;j<response.data.length;j++) {
   for(j=0;j<response.data.length;j++) {
-
    if(j>n) { break; }
 
     var item = response.data[j];
     var item = response.data[j];
     var imgSmall = item.picture;
     var imgSmall = item.picture;
     var imgBig = item.source;
     var imgBig = item.source;
-
     html += '<a rel="lightbox[</html>{{{album}}}<html>]" href="'+imgBig+'" target="blank"><img class="</html>{{{css}}}<html>" src=\"'+imgSmall+'"></a>';
+
     var imgName = item.name;
 +
    if(j>n) {
 +
          html += '<a rel="lightbox[</html>{{{album}}}<html>]" href="'+imgBig+'" title="'+imgName+'"></a>';
 +
          }else{
 +
          html += '<a rel="lightbox[</html>{{{album}}}<html>]" href="'+imgBig+'" title="'+imgName+'"><img class="</html>{{{css}}}<html>" src=\"'+imgSmall+'"></a>';
 +
          }
   }
   }
   $("#photobox" + albumID).html(html);
   $("#photobox" + albumID).html(html);

Revision as of 11:58, 8 August 2012


Intro

This is a template page that lists all pictures from a facebook album.

Either use this template or give credits to the TU Delft team! If you have questions, contact me: Jelmer Cnossen

How To Use This

  • Find a facebook album ID to display, using fb_listalbums
  • Put the generated code from fb_listalbums in your wiki, and modify it.

Parameters


{{:Team:TU_Delft/fb_photodisplay|album=ID|count=Number of images|css=CSS class}}
Parameters: 
album: Facebook album ID
count: Number of pictures to display
css: CSS class for each image
callback: Javascript callback function name, callback(container)


loading facebook photos...