diff --git a/docs/setup/changing-the-colors.md b/docs/setup/changing-the-colors.md index 15e6d0244..07106b8eb 100644 --- a/docs/setup/changing-the-colors.md +++ b/docs/setup/changing-the-colors.md @@ -38,10 +38,14 @@ Click on a tile to change the color scheme: var buttons = document.querySelectorAll("button[data-md-color-scheme]") buttons.forEach(function(button) { button.addEventListener("click", function() { + document.body.setAttribute("data-md-color-switching", "") var attr = this.getAttribute("data-md-color-scheme") document.body.setAttribute("data-md-color-scheme", attr) var name = document.querySelector("#__code_0 code span.l") name.textContent = attr + setTimeout(function() { + document.body.removeAttribute("data-md-color-switching") + }) }) })