No problem ;) you missed one little thing.
This gets fired two times:
sum += $(this).width() +1;
...you edited it one time in the resize function but not in the window load function.
the complete jquery should look like this:
$(document).ready(function() {
showHeight('document', $(document).height());
function showHeight(ele, h) {
$('.picture img').css( 'height', h -30 );
$('#img-container').css( 'height', h -30 );
}
});
$(window).resize(function() {
showHeight('window', $(window).height());
function showHeight(ele, h) {
$('.picture img').css( 'height', h -30 );
$('#img-container').css( 'height', h -30 );
}
var sum = 0;
$('.picture img').each(function()
{
sum += $(this).width() +21;
});
$('#img-container').width( sum );
});
$(window).load(function(){
showHeight('document', $(document).height());
function showHeight(ele, h) {
$('.picture img').css( 'height', h -30);
}
var sum = 0;
$('.picture img').each(function()
{
sum += $(this).width() +21;
});
$('#img-container').width( sum );
});