Problem on transition

Problem on transition

Hi guys, i have this problem... I would like to change page, show the loading icon and when the transition is ended (or the page is ready) hide the loading icon. All works fine if i don't put in pageconteiner {transition: "none"}.


I need to set trandition none because some old mobile don't accept transition (flash, blink on transition), so i have discriminate this with device= false. This code now work for transition, but don't work for loading icon... never hides.
For replay the error var device=false;

Any suggest?