Need help width changing the style of wap to web

ngmanhmedia69

New Member
Messages
7
Reaction score
0
Points
0
I want to my site automatically
switch interface when mobile
use and when to use
computer, how do?
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
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
HTML:
<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" />

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:
<script type="text/javascript"> // <![CDATA[
  if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1)) {
    document.location = "mobile/";
  } // ]]>
</script>
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
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).
 
Top