You can listen for the mdl-componentupgraded event in the layout element, .mdl-ayout .
$(document).ready(function() { $('.mdl-layout').on('mdl-componentupgraded', function(e) { if ($(e.target).hasClass('mdl-layout')) { alert('ready'); } }); });
Use on instead of one . Your page may be updated with several elements. Using one , you will catch only the first update. With on handler will be called several times due to the event bubble. Check e.target to respond to a specific update to the layout element.
Use the callback $(document).ready() . Wait until the DOM is ready before attaching handlers to its elements. Otherwise, the $('.mdl-layout') selector may not match, and the event handler may not attach.
source share