Here is my code below.
I just donβt know how to do this if the connection goes from ONLINE to OFFLINE, which is an event that updates css ( https://github.com/hubspot/offline ).
If it switches from OFFLINE to ONLINE, it is updated within 10 seconds. But I'm not sure how this works in another direction?
It seems if I call Offline.check (); manually it will be updated, but ideally I would like it to be done automatically. Any ideas are welcome.
Offline.options = {
checkOnLoad: true,
checks: {
image: {
url: 'http://example.com/image.gif'
},
active: 'image'
},
reconnect: {
initialDelay: 10, // only check every 10 seconds
delay: 10
}
};
source
share