Get Microthemer: [ Ссылка ]
Code for the document ready function shown in the video:
function docReady(fn) {
// see if DOM is already available
if (document.readyState === "complete" || document.readyState === "interactive") {
// call on next available tick
setTimeout(fn, 1);
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
Use the document ready function:
docReady(function() {
// DOM is loaded and ready for manipulation - add your code here
});
Ещё видео!