Reloading a Flickr request from author
Posted
by
user1797325
on Stack Overflow
See other posts from Stack Overflow
or by user1797325
Published on 2012-11-04T00:14:20Z
Indexed on
2012/11/04
5:01 UTC
Read the original article
Hit count: 210
I have my flickr gallery coded, but I want to be able to click on the Author's name and the page will reload just with the images from that author.
Here is my current code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Outbrain Test Gallery</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="jquery.masonry.min.js"></script>
<script type="text/javascript">
$(window).load(function(){
$('#flkr').masonry({
// options
itemSelector : '.tiles',
isResizable: true,
});
});
</script>
<script type="text/javascript">$(document).ready(function() {
$('<ul />').prependTo('#flkr');
$.getJSON('http://api.flickr.com/services/feeds/photos_public.gne?lang=en-us&format=json&jsoncallback=?', function(data) {
$.each(data.items, function(i,item) {
var squares = (item.media.m).replace('_m.jpg', '_q.jpg');
if(i <= 20){
$('<img/>').attr({
alt: item.title,
src: squares,
height: '150',
width: '150'
}).appendTo('#flkr ul').wrap('<li class="tiles"><a href="' + item.link + '"></a><p class="title">' + item.title + '</p><p class="author"><strong>By:</strong> ' + item.author + '</p><p class="date"><strong>Uploaded: </strong>' + item.published + '</p></li>');
}
});
});
});
</script>
</head>
<body>
<ul id="flkr"></ul>
</body>
</html>
© Stack Overflow or respective owner