-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustom.js
36 lines (33 loc) · 897 Bytes
/
custom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$(document).ready(function() {
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
{
tags: "peanut butter",
tagmode: "any",
format: "json"
},
function(data) {
$.each(data.items, function(i,item){
$("<img/>").attr("src", item.media.m).appendTo("#images");
if ( i == 20 ) return false;
});
});
});
$(document).ready(function(){
$("a").toggle(function(){
$(".stuff").animate({ height: 'hide', opacity: 'hide' }, 'slow');
},function(){
$(".stuff").animate({ height: 'show', opacity: 'show' }, 'slow');
});
});
// $.getJSON('ajax/test.json', function(data) {
// var items = [];
//
// $.each(data, function(key, val) {
// items.push('<li id="' + key + '">' + val + '</li>');
// });
//
// $('<ul/>', {
// 'class': 'my-new-list',
// html: items.join('')
// }).appendTo('body');
// });