How to Show Message or a Page if i went to Offline Suddenly When i am Using Online application ?

hi all, I am working  on Online Hybrid mobile and tablet . if suddenly my internet went out means i  am getting errror message but i want to show case an user friendly message like “No internet available ”  or it should navigate to a page if it went to offline . any Ideas will be appreciable thanks in advance  
1 answers

You can use the mobile features widget for this: 

There is an offline-class that is set when the app turns offline. You can set this class on a specific part of a page or lay-out with an offline message.