Here is my code below.
Simply, I don't know how to make it that if the connection transitions from ONLINE to OFFLINE, that the event which updates the css (https://github.com/hubspot/offline) will be triggered.
If it goes from OFFLINE to ONLINE, then it updates within 10 seconds. But I'm not sure how to have it work in the other direction?
It seems if I call Offline.check(); manually it will update, but ideally I'd like it to do this automatically. Any ideas 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
}
};