Solved

Mobile Page redirection

Posted on 2011-03-14
2
312 Views
Last Modified: 2012-05-11
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
Comment
Question by:zrazak
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 35131508
0
 

Author Closing Comment

by:zrazak
ID: 35158915
wasnt very specific
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now