Hello! I'm wondering if anyone could help me debug...
# 🔥-django-htmx
m
Hello! I'm wondering if anyone could help me debug something with htmx:xhr:loadstart. I have a script loaded at the bottom of my base template that is intended to turn the main window of my app to oppacity 0.1 while loading and back to 1 when finished. The script works great... but only one time. I can't figure out why this is. I will refresh the browser, click something, the app windows dims, but then the second click does not work. Here is the code (sorry, bad formatting) document.body.addEventListener('htmx:xhr:loadstart', function(evt) { const body = document.getElementById('main_content') body.style.opacity = 0.1 }); document.body.addEventListener('htmx:xhr:loadend', function(evt) { const body = document.getElementById('main_content') body.style.opacity = 1.0 }); Thanks in advance!