[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

Mobile Page redirection

Is there any way this code can be implement if its a mobile website jump to a mobile page else
jump to a desktop page.  Can the media query code be implemented in any way to do so since media query is checking if is a mobile device then jump to mobile version?

Any Help is greatly appreciated.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html;
 charset=iso-8859-1">
 
    <title></title>
    <link rel="stylesheet" type="text/css" href="mobile.css" />
  
  <link rel="stylesheet" type="text/css" href="desktop.css" />
  
     <style type="text/css">
     @media only screen and (max-width: 480px),  only screen and (max-device-width: 480px), only screen and (max-device-width: 800px){
	#mobile { text-transform:capitalize  }
	
	
   </style>
    <script src="Script/jquery-1.4.4.js" type="text/javascript"></script>

     <script type="text/javascript">
         $(function () {

             mobileResize();

             $(window).resize(function () {
                 mobileResize();
             });

         });

         function mobileResize() {
             if ($("#mobile").css("text-transform") == "capitalize") {
                 $("#mobile").css("display", "block");
                 $("#desktop").css("display", "none");
             } else {
                 $("#mobile").css("display", "none");
                 $("#desktop").css("display", "block");
             }
         }
      </script>
</head>
<body >
     
    <form id="form1" runat="server">
    <div>
    <h1>This device is:  </h1> 
        
         <div id="desktop">Desktop</div>  

         <div id="mobile">Mobile</div> 

       
       
        
    </div>
    </form>
   
</body>
</html>

Open in new window

0
zrazak
Asked:
zrazak
1 Solution
 
zrazakAuthor Commented:
wasnt very specific
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now