0

I'm developing an application for Ipad. So I need to change the image rendering depending upon the devide wheteher it is ipad or ipad-retina . So can anybody tell me how to detect the difference between ipad and ipad-retina? Thanx!!!!!!!

2 Answers2

1
var isRetina = window.devicePixelRatio > 1;

Check this out: Detect retina displays with javascript.

Joseph Silber
  • 214,931
  • 59
  • 362
  • 292
  • be sure to check that code in both orientations - ISTR that the pixel ratio changes for landscape vs portrait. – Alnitak Apr 12 '13 at 14:25
0
var retina = (window.retina || window.devicePixelRatio > 1);

Resource: http://hjzhao.blogspot.in/2012/07/detect-retina-display-using-javascript.html

Also use Modernizr

https://github.com/benlister/utilities/tree/master/Modernizr%20Retina%20:%20HiDPI%20test

Tamil Selvan C
  • 19,913
  • 12
  • 49
  • 70