I want to my site automatically
switch interface when mobile
use and when to use
computer, how do?
I want to my site automatically
switch interface when mobile
use and when to use
computer, how do?
Would you like it to switch the stylesheet or switch the page completely?
If so, I think you can use this to make a mobile specific CSS. I think the first one is for computer and the second is for handheld devices
If you want to redirect mobile devices to a different place, you can use a method like this. In the below example, you can place this in between the <head> and </head>. It's only configured for iPhone/iPod, but I'm sure you can find ways to extend it to other mobile devices like Android:HTML Code:<link rel="stylesheet" href="http://domain.tld/screen.css" type="text/css" media="Screen" /> <link rel="stylesheet" href="http://domain.tld/mobile.css" type="text/css" media="handheld" />
HTML Code:<script type="text/javascript"> // <![CDATA[ if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1)) { document.location = "mobile/"; } // ]]> </script>
One of the best resources on the web is A List Apart, and they just happen to have a couple of articles that are exactly on point:
Responsive Web Design
Fluid Images
WAP isn't covered, but WAP is a dying horse. Most mobile devices these days don't use the WAP version of a site, they use the "real web". Responsive design, using media queries, will right-size and right-format your site for modern smart phones and other small-form-factor devices (like 7"-format tablets and so forth).
“Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
"It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)