[quote="dziudek"]Ok I got the reason of your problems.
iPad 3 uses the 1024x768 resolution for media queries - the android devices don't decrease the real resolution.
The solution is included in the following code:
- Code: Select all
// it is iPad, iPod or iPhone?
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
// set media query for the tablet.css
if($iPod || $iPhone || $iPad) {
$this->API->addCSS($this->API->URLtemplate() . '/css/tablet.css','text/css','only screen and (max-width: '.$tablet_width.'px), only screen and (max-device-width: '.$tablet_width.'px)');
} else {
$this->API->addCSS($this->API->URLtemplate() . '/css/tablet.css','text/css','only screen and (max-width: '.$tablet_width.'px), only screen and (max-device-width: '.$tablet_width.'px) and (-moz-max-device-pixel-ratio: 1.5), only screen and (max-device-width: '.$tablet_width.'px) and (-o-max-device-pixel-ratio: 1.5/1), only screen and (max-device-width: '.$tablet_width.'px) and (-webkit-max-device-pixel-ratio: 1.5), only screen and (max-device-width: '.$tablet_width.'px) and (max-device-pixel-ratio: 1.5), only screen and (max-device-width: '.($tablet_width * 2).'px) and (-moz-min-device-pixel-ratio: 2), only screen and (max-device-width: '.($tablet_width * 2).'px) and (-o-min-device-pixel-ratio: 2/1), only screen and (max-device-width: '.($tablet_width * 2).'px) and (-webkit-min-device-pixel-ratio: 2), only screen and (max-device-width: '.($tablet_width * 2).'px) and (min-device-pixel-ratio: 2)');
}
// set media query for the mobile.css
if($iPod || $iPhone || $iPad) {
$this->API->addCSS($this->API->URLtemplate() . '/css/mobile.css','text/css','
only screen and (max-width: '.$mobile_width.'px), only screen and (max-device-width: '.$mobile_width.'px)');
} else {
$this->API->addCSS($this->API->URLtemplate() . '/css/mobile.css','text/css','
only screen and (max-width: '.$mobile_width.'px),
only screen and (max-device-width: '.$mobile_width.'px) and (-moz-max-device-pixel-ratio: 1.5),
only screen and (max-device-width: '.$mobile_width.'px) and (-o-max-device-pixel-ratio: 1.5/1),
only screen and (max-device-width: '.$mobile_width.'px) and (-webkit-max-device-pixel-ratio: 1.5),
only screen and (max-device-width: '.$mobile_width.'px) and (max-device-pixel-ratio: 1.5),
only screen and (max-device-width: '.($mobile_width * 2).'px) and (-webkit-min-device-pixel-ratio: 2),
only screen and (max-device-width: '.($mobile_width * 2).'px) and (-moz-min-device-pixel-ratio: 2),
only screen and (max-device-width: '.($mobile_width * 2).'px) and (-o-min-device-pixel-ratio: 2/1),
only screen and (max-device-width: '.($mobile_width * 2).'px) and (min-device-pixel-ratio: 2)');
}
dziudek,
I know this is about a month old, but have these changes made it into ver. 3.5.1 of the Bikestore template?
The reason for asking is, that I still have this problem on 3.5.1 - and if I implement a combination of the 2 fixes above, I do get the problem solved on iPad 3 - but then I get no mobile version on my Android phone (LG 4x HD with res. 720x1280px) which gives problems displaying my site (
http://www.macstickers.dk) in portrait mode.
Could I trouble you for a post containing a patched version of the helper.layout.php file for the bikestore template, which works with both smartphones, iPads and Desktops just to be sure i'm not making errors here?
Cheers,
Zorroson