javascriptjquerycssmedia-queriesipad-3

Target iPad3 but not iPad4


I'm try to add some css that will need to execute on iPad 3, but not iPad 4 or vice verse. I'm able to target both leaving the old version with:

   @media
   only screen and (-webkit-min-device-pixel-ratio: 2),
   only screen and (   min--moz-device-pixel-ratio: 2),
   only screen and (     -o-min-device-pixel-ratio: 2/1),
   only screen and (        min-device-pixel-ratio: 2),
   only screen and (                min-resolution: 192dpi),
   only screen and (                min-resolution: 2dppx) { }

but so far I can't find a difference to target between 3 and 4. Any css or JS solutions out there. Any help will be greatly appreciated


Solution

  • You can't get any difference by using media queries or user-agents:

    So there is only javascript+iOS feature detecting like was with iPad and iPad2 difference in event.acceleration, but there is no different in features of iPad3 and iPad4.

    So you can't detect iPad3 only. May be you post here the problem with iPad3 and we can help you to solve it?

    BUT:

    If you use WebView component, you can do it in it. You can detect in by systemInfo.machine string in Objective-C:

    NSString *machineName = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
    

    machineName for iPad3 are iPad3,1, iPad3,2 and iPad3,3. iPad4 are iPad3,4, iPad3,5 and iPad3,6 (don't ask why:)

    And in WebView you can change your css file to iPad3.css by using WebResourceLoadDelegate for example.