Overlay hiding not working when using both AjaxStart and custom svg file
See original GitHub issueHow to reproduce:
- As mentioned in the docs, set the Ajax requests to trigger the loadingOverlay
$(document).ajaxStart(function(){
$.LoadingOverlay("show");
});
$(document).ajaxStop(function(){
$.LoadingOverlay("hide");
});
- Then in a custom jquery/javascript function, for example in my case on a button click, trigger the loadingOverlay
$.LoadingOverlay("show");
- When the request ends and you want to close the overlay, simply call:
$.LoadingOverlay("hide");
Expected behavior: Close the overlay Observed behavior: The overlay is not hidden correctly
In fact, the problem is that 2 instances of the overlay are created. One for custom request which creates a new overlay, which is fine as we call the $.LoadingOverlay("show");
, and another one caused by the AjaxStart event, triggered by the SVG file element.load()
call
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How can I create a "Please Wait, Loading..." animation using ...
The approach I'm taking below will show you how to accomplish both methods. ... a loading overlay, keep it hidden and then unhide...
Read more >jQuery LoadingOverlay - Gaspare Sganga
It supports both raster images and vectorial SVGs. You can pass an inline SVG, a path to a file or even use a...
Read more >.ajaxStart() | jQuery API Documentation
Any and all handlers that have been registered with the .ajaxStart() method are executed at this time. To observe this method in action,...
Read more >Simple Flexible Loading Overlay Plugin With jQuery
loadingoverlay.js is a simple, flexible jQuery plugin which shows a highly customizable loading overlay with custom spinners while loading ...
Read more >Wikipedia, the free encyclopedia.webarchive
display: block; height: 0; clear: both; visibility: hidden; ... Uses DOM calls to avoid document.write + XHTML issues var linkHolder = document.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That turned out to be an easier fix than expected. jQuery’s parameter
global
for Ajax method came in handy. I will release the patched version in a few minutes.Glad I could help a bit 😃 Thanks for the quick patch!