Custom Headers: Ensure the ready event fires before fetching the existing headers to apply jQuery.masonry. see #20346, #21820.

git-svn-id: https://develop.svn.wordpress.org/trunk@22504 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-11-09 11:55:20 +00:00
parent db0ad6a120
commit c4b070dd07
1 changed files with 9 additions and 6 deletions

View File

@ -1,10 +1,13 @@
(function($) {
// Fetch available headers and apply jQuery.masonry
// once the images have loaded.
$( function() {
var $headers = $('.available-headers');
var headers = $('.available-headers');
headers.imagesLoaded( function() {
headers.masonry({
itemSelector: '.default-header'
$headers.imagesLoaded( function() {
$headers.masonry({
itemSelector: '.default-header'
});
});
});
})(jQuery);
}(jQuery));