How to Disable All Auto Preset Tempo Events
I am trying to use the Pace preloader plugin. I want to disable all automatic preloader and I want this to happen on a specific event. I checked the doc and gave the code as shown below.
Pace.options = {
ajax: false,
document: false,
eventLag: false,
elements:false
}
If I give this before enabling pace.js
, I might get an undefined error. But I cannot include it after including the script as well, since it is called automatically and immediately. So I tried the following optionwindow
window.paceOptions = {
ajax: false,
document: false,
eventLag: false,
elements:false
}
and tried another code using HTML data option
<script data-pace-options='{ "document":false,"eventLag:":false,"elements":false,"ajax": false }' src="../pace.js"></script>
But nobody worked. When the page loads, I see a preloader. I don't want to receive it.
How do I disable it?
+3
source to share