0

I'm hoping someone can assist me. I have the following in my jQuery to detect iOS so I can hide a preloader. It only works on some and I'm not sure why. The abbreviated version is here:

jQuery(window).load(function () {
        var iOS = false,
        p = navigator.platform;
        if (p === 'iPad' || p === 'iPhone' || p === 'iPod') {
            iOS = true;
        }
        if (iOS) {
            $('#preloader').hide();
        }
   else {
            // hide preloader after loaded
            jQuery('#preloader').delay(300).fadeOut(300);
        }
});

The preloader is a black screen that fades away and was not working across all iOS devices. So I thought hiding would be the way to go. However, I am unable to even target iOS across versions.

Any ideas?

UPDATE: It even works across version 8.3 but not iPad Mini and yes on iPad Air. Really strange.

jallen
  • 602
  • 12
  • 32
  • Maybe this thread could be of help: http://stackoverflow.com/questions/4617638/detect-ipad-users-using-jquery – Reality-Torrent Jan 25 '17 at 14:05
  • Just tried it and still won't hide the preloader. On browserstack.com/responsive for testing across devices/OS. – jallen Jan 25 '17 at 14:18

0 Answers0