Index: src/wp-content/themes/twentythirteen/functions.php
===================================================================
--- src/wp-content/themes/twentythirteen/functions.php	(revision 38082)
+++ src/wp-content/themes/twentythirteen/functions.php	(working copy)
@@ -173,7 +173,7 @@
 		wp_enqueue_script( 'jquery-masonry' );
 
 	// Loads JavaScript file with functionality specific to Twenty Thirteen.
-	wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true );
+	wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160717', true );
 
 	// Add Source Sans Pro and Bitter fonts, used in the main stylesheet.
 	wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
Index: src/wp-content/themes/twentythirteen/js/functions.js
===================================================================
--- src/wp-content/themes/twentythirteen/js/functions.js	(revision 38082)
+++ src/wp-content/themes/twentythirteen/js/functions.js	(working copy)
@@ -119,9 +119,13 @@
 	/**
 	 * Arranges footer widgets vertically.
 	 */
-	if ( $.isFunction( $.fn.masonry ) ) {
-		var columnWidth = body.is( '.sidebar' ) ? 228 : 245,
-			widgetArea = $( '#secondary .widget-area' );
+	$( function() {
+		var columnWidth, widgetArea;
+		if ( ! $.isFunction( $.fn.masonry ) ) {
+			return;
+		}
+		columnWidth = body.is( '.sidebar' ) ? 228 : 245;
+		widgetArea = $( '#secondary .widget-area' );
 
 		widgetArea.masonry( {
 			itemSelector: '.widget',
@@ -157,5 +161,5 @@
 				}
 			} );
 		}
-	}
+	} );
 } )( jQuery );
\ No newline at end of file
