Team:TU Delft/fb display

From 2010.igem.org

(Difference between revisions)
Line 21: Line 21:
<script type="text/javascript">
<script type="text/javascript">
-
 
-
var albumID = "</html>{{{album|135033906513449}}}<html>";
 
function fb_photos</html>{{{album|135033906513449}}}<html>(response) {
function fb_photos</html>{{{album|135033906513449}}}<html>(response) {
Line 51: Line 49:
$(function() {
$(function() {
 +
 +
var albumID = "</html>{{{album|135033906513449}}}<html>";
var baseurl = "https://graph.facebook.com/";
var baseurl = "https://graph.facebook.com/";
Line 56: Line 56:
function addScript(url) {
function addScript(url) {
   var html = '<script src="'+ url + '" type="text/javascript"></scr'+'ipt>';
   var html = '<script src="'+ url + '" type="text/javascript"></scr'+'ipt>';
-
   $("#fb_scriptload</html>{{{album|135033906513449}}}<html>").html(html);
+
   $("#fb_scriptload" + albumID).html(html);
}
}
function fetchPhotos() {
function fetchPhotos() {
-
   addScript(baseurl + "/" + albumID + "/photos?callback=fb_photos</html>{{{album|135033906513449}}}<html>");
+
   addScript(baseurl + "/" + albumID + "/photos?callback=fb_photos"+albumID);
}
}
-
var boxid = "#photobox</html>{{{album|135033906513449}}}<html>";
+
$("#photobox" + albumID).delay(200).queue(fetchPhotos);
-
$(boxid).delay(200).queue(fetchPhotos);
+
});
});
</script>
</script>
</html>
</html>

Revision as of 22:10, 27 July 2010


This is a template page that displays random pictures from a facebook album.

{{:Team:TU_Delft/fb_display|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


loading facebook photo's...