Today shinchoku

This commit is contained in:
cutls
2020-07-12 00:48:15 +09:00
parent 2c54e43e37
commit 78a8c2bdce
4 changed files with 133 additions and 208 deletions

View File

@@ -314,4 +314,12 @@ function setAllClasses(query, className, action) {
if(action == 'remove') target.classList.remove(className)
}
}
function appendPrepend(query, elm, action) {
const allTarget = document.querySelectorAll(query)
for (let i = 0; i < allTarget.length; i++) {
const target = allTarget[i]
if(action == 'prepend') target.prependChild(elm)
if(action == 'append') target.appendChild(elm)
}
}
const sleep = msec => new Promise(resolve => setTimeout(resolve, msec));