Skip to content

Instantly share code, notes, and snippets.

@joshellington
Created December 11, 2011 22:00
Show Gist options
  • Save joshellington/1463009 to your computer and use it in GitHub Desktop.
Save joshellington/1463009 to your computer and use it in GitHub Desktop.
function build() {
var images = [];
$('.image').each(function() {
var position = $(this).data('isotope-item-position'),
img = $(this).find('img'),
src = $(img).attr('src'),
w = $(img).width(),
h = $(img).height();
var image = {
'src': src,
'x': position.x,
'y': position.y,
'width': w,
'height': h
};
images.push(image);
});
$.post('/build/', {'images': images}, function(d) {
log('-----------')
log('build results');
log(d);
log('-----------')
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment