我对我的 flickr 画廊进行了编码,但我希望能够单击作者的姓名,页面将重新加载该作者的图像。
这是我当前的代码
<!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>