Bootstrap 3 - Show Desktop View

by Kyle Mitofsky

HTML

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css">
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<h2>Page Width: <span id="dimensions"></span></h2>

<div class="visible-lg">Desktop View!</div>
















<!-- Post Info -->
<div style='position:fixed;bottom:0;left:0;    
            background:lightgray;width:100%;'>
    About this SO Question: <a href='http://stackoverflow.com/q/24498517/1366033'>How to show desktop version on mobile screens</a><br/>
<div>

CSS

</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>

JavaScript

$(window).resize(function() {
    $("#dimensions").html($(window).width());
}).resize();

$(window).resize(function() {
    var mobileWidth =  (window.innerWidth > 0) ? 
                        window.innerWidth : 
                        screen.width;
    var viewport = (mobileWidth > 360) ?
                    'width=device-width, initial-scale=1.0' :
                    'width=1200';
    $("meta[name=viewport]").attr('content', viewport);
}).resize();