?
Solved

Mobile Page redirection

Posted on 2011-03-14
2
Medium Priority
?
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 1500 total points
ID: 35131508
0
 

Author Closing Comment

by:zrazak
ID: 35158915
wasnt very specific
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

743 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