Does it work if you test on a browser on your PC ? It should work when you switch tab.
What browser do you use on your phone ?
Do you still have any error ? If yes, can you post them ?
Do you have Chrome installed on your phone ? Can you try accessing a build directly from the browser instead of the packaged version ?
EDIT: Maybe this page can be of some help ? http://caniuse.com/#feat=pagevisibility
I needed the webkit prefix to make it work on my phone but maybe you don't ?