Webmobile - introduction aux sites mobiles

1,535 views

Published on

Introductions aux sites mobiles

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,535
On SlideShare
0
From Embeds
0
Number of Embeds
134
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Webmobile - introduction aux sites mobiles

  1. 1. Evolution du marché des smartphones
  2. 2.
  3. 3. RewriteEngine On RewriteCond %{HTTP_USER_AGENT} "ipod|iphone|ipad" [NC,OR] RewriteCond %{HTTP_USER_AGENT} "android|palm" RewriteRule (.*) http://m.votredomaine.com [R=301,L]
  4. 4. function isMobile() { //User agent $ua = $_SERVER['HTTP_USER_AGENT']; //test si il s'agit d'un mobile return preg_match('/iphone/i',$ua) || preg_match('/android/i',$ua) || preg_match('/blackberry/i',$ua); }
  5. 5. if ( (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/Android/i) ) ) { window.location = "http://mobile.votredomaine.com"; }
  6. 6. <link type="text/css" rel="stylesheet" media="only screen and (max-device-width: 480px)" href="mobile.css">

×