5,073
edits
David Mason (talk | contribs) No edit summary |
David Mason (talk | contribs) No edit summary |
||
| Line 36: | Line 36: | ||
} | } | ||
} | } | ||
function include(url){ | |||
if(url.match(/\.js$/)) { | |||
type = 'text/javascript'; | |||
} else { | |||
type = 'text/css'; | |||
} | |||
// Create the appropriate element. | |||
var tag = null; | |||
switch( type ){ | |||
case 'text/javascript' : | |||
tag = document.createElement( 'script' ); | |||
tag.type = type; | |||
tag.src = url; | |||
break; | |||
case 'text/css' : | |||
tag = document.createElement( 'link' ); | |||
tag.rel = 'stylesheet'; | |||
tag.type = type; | |||
tag.href = url; | |||
break; | |||
} | |||
document.getElementsByTagName("head")[0].appendChild(tag); | |||
} | |||
include('/js/packery.pkgd.min.js'); | |||
var container = document.querySelector('#homeThumbs'); | |||
var pckry = new Packery( container, { | |||
// options | |||
itemSelector: '.homeThumb', | |||
gutter: 10 | |||
}); | |||