Thanks for clarifying — you want to keep your current loader implementation, but make sure it appears on top of the modal when showLoader() is called.
Here’s how you can fix this directly in your existing setup, without adding new loader HTML:
✅ Step 1: Check Your Loader Element
Find the existing loader element you are calling with showLoader(), e.g.:
If you already have this, add or update its CSS:
🎨 Step 2: Apply High Z-Index and Fixed Position
Update the CSS for #loader:
✅ Step 3: Make Sure showLoader() Shows That Element
In your JS, you probably already have:
If not, define it this way.
✅ Optional: Spinner Inside Loader
If you want a spinner in the center of the loader:
Summary:
-
Keep your current code.
-
Just make sure your #loader has:
-
position: fixed
-
z-index: 9999 or more
-
No need to move the modal or loader in the DOM.
-
Don't hide the modal if you want loader above it.
Let me know if you want me to inspect your existing loader structure based on your current HTML.