Skip to content

Instantly share code, notes, and snippets.

@davidrhoden
Created November 15, 2012 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidrhoden/4080006 to your computer and use it in GitHub Desktop.
Save davidrhoden/4080006 to your computer and use it in GitHub Desktop.
why doesn't the code in $.each run?
$(document).ready(function(){
var width = 740;
console.log(width);
$.each($('.overview img'), function(i, img) {
width += $(img).width();
console.log($('.overview img'), width);
});
$('.overview').width(width);
console.log(width);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment