Team:TU Delft/fb display
From 2010.igem.org
(Difference between revisions)
Line 11: | Line 11: | ||
</noinclude> | </noinclude> | ||
<html> | <html> | ||
- | <div id="fb_scriptload"></div> | + | <div id="fb_scriptload</html>{{{album|135033906513449}}}<html>"></div> |
- | <div id="photobox">loading facebook photo's...</div> | + | <div id="photobox</html>{{{album|135033906513449}}}<html>">loading facebook photo's...</div> |
<style> | <style> | ||
- | .fb_photo { | + | .fb_photo</html>{{{album|135033906513449}}}<html> { |
margin: 4px 4px 4px 4px; | margin: 4px 4px 4px 4px; | ||
} | } | ||
Line 24: | Line 24: | ||
var albumID = "</html>{{{album|135033906513449}}}<html>"; | var albumID = "</html>{{{album|135033906513449}}}<html>"; | ||
- | function fb_photos(response) { | + | function fb_photos</html>{{{album|135033906513449}}}<html>(response) { |
var n = </html>{{{count|6}}}<html>; | var n = </html>{{{count|6}}}<html>; | ||
var imghtml = ""; | var imghtml = ""; | ||
Line 43: | Line 43: | ||
var item = remaining.splice(x, 1)[0]; | var item = remaining.splice(x, 1)[0]; | ||
var imgSmall = item.picture; | var imgSmall = item.picture; | ||
- | imghtml += '<a href="'+ item.link +'"><img class="</html>{{{css| | + | imghtml += '<a href="'+ item.link +'"><img class="</html>{{{css|fb_photo135033906513449}}}<html>" src=\"'+imgSmall+'"></a>'; |
j++; | j++; | ||
} | } | ||
- | $("#photobox").html(imghtml); | + | $("#photobox</html>{{{album|135033906513449}}}<html>").html(imghtml); |
} | } | ||
Line 54: | Line 54: | ||
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(html); | + | $("#fb_scriptload</html>{{{album|135033906513449}}}<html>").html(html); |
} | } | ||
function fetchPhotos() { | function fetchPhotos() { | ||
- | addScript(baseurl + "/" + albumID + "/photos?callback=fb_photos"); | + | addScript(baseurl + "/" + albumID + "/photos?callback=fb_photos</html>{{{album|135033906513449}}}<html>"); |
} | } | ||
$(function() { | $(function() { | ||
- | + | var boxid = "#photobox</html>{{{album|135033906513449}}}<html>"; | |
+ | $(boxid).delay(200).queue(fetchPhotos); | ||
}); | }); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 22:04, 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...