<html> and <body> need height:100% as well. By the way, consider targeting
these devices using a @media query:

http://www.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/

Chris

On Sun, May 15, 2011 at 5:44 AM, Charlie <[email protected]> wrote:

> I am trying to create a script to display a map on a popup window on
> the computer or a full screen map on the iphone. The script I am using
> is...
>
> var useragent = navigator.userAgent;
>  if (useragent.indexOf('iPhone') != -1 ||
> useragent.indexOf('Android') != -1 ) {
> document.write("<div id='map_canvas' style='width:100%; height:100%'></
> div>");
>  } else {
> document.write("<div id='map_canvas' style='width:800px; height:
> 600px'></div>");
> }
>
> It works fine on the computer, but the map is ignored on the iphone
> window. Example file is located at http://www.gensoup.org/launch.html
> which has a link to target.html which is supposed to display the map.
>
> What am I doing wrong?
>
> Thanks,
> Charlie
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>


-- 
http://twitter.com/broady

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to