RequireJS newbie here. Trying to convert some JQuery code I had working fine in the old way to work w/ RequireJS.
Header of my page loads three JS files via script tags
Try this instead:
require([
'jquery',
'jquery.masonry',
'jquery.imagesloaded',
], function($, Masonry, ImagesLoad) {
// The following code worked just fine when I included it in the header of the page as-is
$(function() {
var $container = $('#container');
// This doesn't work
$container.imagesLoaded(function() {
// Neither does this
$('#container').masonry({itemSelector : '.item',});
});
});
});