Suggestion: onStart function
- Dominant language
- JavaScript
- Stars
- 711
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
Hey guys,
Pretty neat plugin, the only one which worked for me out of the box.
Here's my case:
I've designed a preloading screen which involves an image, a loading wheel and the bar.
I'm trying to add some content after the queryloader__overlay__bar as a div which I can populate with my content and I'm doing it via the onProgress function:
```
window.addEventListener('DOMContentLoaded', function() {
new QueryLoader2(document.querySelector("body"), {
barColor: #323232,
backgroundColor: "#fff",
overlayId: 'qLoverlay',
barHeight: 2,
percentage: false,
minimumTime: 20000,
fadeOutTime: 300,
onProgress: function() {
jQuery('.queryloader__overlay__bar').after('
}
});
});
```
However, the spinner class is added for every single item it identifies on the page. So if the page has 10 images it needs to wait for, I will have 10 spinner divs. http://prntscr.com/pwfggs
Is there a way to limit the onProgress function to only 1? Or alternatively, there might be a need for an onStart function which will complement the onProgress and onComplete.
Thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the QueryLoader2 implementation and the existing onProgress and onComplete callback handling described in the issue. Trace when progress runs for each identified asset, then define the requested one-time startup behavior and its callback semantics. Done means the spinner use case can add its content once without repeated additions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100