On my website, ever since I added javascript it seems to look fine on PC but zoomed right in on tablets and phones. Here is my code:
HTML
<!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>
<title>Website</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="navbar.css" rel="stylesheet" type="text/css" />
</head>
<body class="menu">
<header>
<a href="#" class="menu-toggle"><img src="http://i.imgur.com/p2Yxaex.jpg" onmouseover="this.src='http://i.imgur.com/Vrl4tBl.jpg'" onmouseout="this.src='http://i.imgur.com/p2Yxaex.jpg'" /></a>
<nav class="menu-side">
This is a side menu
</nav>
</header>
<center>Content Here
</center>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<script>
(function() {
var body = $('body');
$('.menu-toggle').bind('click', function() {
body.toggleClass('menu-open');
return false;
});
})();
var $body = $('body');
$body.on('click', function(event) {
var clickedOutside = $(event.target).closest('.menu-side').length == 0;
if (clickedOutside && $body.hasClass('menu-open')) {
$body.removeClass('menu-open');
}
})
</script>
</body>
</html>
CSS
@charset "utf-8";
/* CSS Document */
.menu {
overflow-x:hidden;
position: relative;
left: 0px;
}
.menu-open {
left: 231px;
}
.menu-open .menu-side {
left: 0;
}
.menu-side,
.menu {
-webkit-transition: left 0.3s ease;
-moz-transition: left 0.3s ease;
transition: left 0.3s ease;
}
.menu-side {
background-color:#333;
border-right:1px solid #000;
color:#fff;
position:fixed;
top: 0;
left: -231px;
width: 210px;
height: 100%;
padding: 10px;
}
Any ideas as to why it’s zooming in and if there would be a way to fix it?