Solved

Mobile Page redirection

Posted on 2011-03-14
2
311 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

747 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