Team:NYU Gallatin/
From 2012.igem.org
(Difference between revisions)
m |
|||
Line 147: | Line 147: | ||
<div id="images"></div> | <div id="images"></div> | ||
<p><a href="/Team:NYU_Gallatin/Notebook/Photos" class="more-link">More Photos</a></p> | <p><a href="/Team:NYU_Gallatin/Notebook/Photos" class="more-link">More Photos</a></p> | ||
- | + | <script type="text/javascript"> | |
+ | <!--//--><![CDATA[// ><!-- | ||
+ | |||
+ | if($('#images').length != 0) { | ||
+ | |||
+ | $.getJSON(flickr_url, displayImages); | ||
+ | function displayImages(data) { | ||
+ | // Start putting together the HTML string | ||
+ | var htmlString = ""; | ||
+ | |||
+ | // Now start cycling through our array of Flickr photo details | ||
+ | var k=0; | ||
+ | $.each(data.items, function(i,item){ | ||
+ | if(k == 0) { | ||
+ | // I only want the ickle square thumbnails | ||
+ | // var sourceSquare = (item.media.m).replace("_m.jpg", "_s.jpg"); | ||
+ | var sourceSquare = item.media.m; | ||
+ | var l_sourceSquare = (item.media.m).replace("_m.jpg", "_b.jpg"); | ||
+ | |||
+ | // Here's where we piece together the HTML | ||
+ | htmlString += '<li><a href="'+l_sourceSquare+'" rel="lightbox">'; | ||
+ | htmlString += '<img title="' + item.title + '" src="' + sourceSquare; | ||
+ | htmlString += '" alt="'; htmlString += item.title + '" />'; | ||
+ | htmlString += ''; | ||
+ | k++; | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | // Pop our HTML in the #images DIV | ||
+ | $('#images').html(htmlString); | ||
+ | |||
+ | // Close down the JSON function call | ||
+ | |||
+ | Drupal.attachBehaviors(); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | //--><!]]> | ||
+ | </script> </div> | ||
</div> | </div> | ||
<div id="block-block-5" class="block block-block"> | <div id="block-block-5" class="block block-block"> |
Revision as of 21:18, 26 September 2012