0

I've got my jquery slideshows looking sharp with retina displays thanks to retina.js, but I only want retina.js to function for non-iPhone retina devices. (iPads and laptops). So, I just need a bit of code to tell retina/js to not function if an iPhone is detected.

Can anyone suggest some code? Thank you!

ian_6500
  • 358
  • 2
  • 10
  • 21

1 Answers1

0

I don't know how you're detecting if the user is on an iPhone but simply loading only retina.js when you deem appropriate should be all you need to do

if (!browser.iphone) $.getScript("path/to/retina.js");

Where browser.iphone is your browser detection code

megawac
  • 10,953
  • 5
  • 40
  • 61
  • Retina.js does a fine job of detecting all things retina, but I want it to make an exception for retina iPhones and not run if one is detected. – ian_6500 Apr 18 '14 at 22:23
  • @ian_6500 as far as I can tell reading [the source](https://github.com/imulus/retinajs/blob/master/src/retina.js) you either need to not load it if you don't need it or mod the source to not call `Retina.init()`. Loading the script conditionally through javascript is the simplest solution – megawac Apr 18 '14 at 22:54