브라우저 뷰포트 크기 확인

3573 단어 html

<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title> title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"/>
head>
<body>
<script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js">script>
<script>
    //  
    $(document).ready(function(e) {
        showViewportSize();
    });
    //  
    $(window).resize(function(e) {
        showViewportSize();
    });
    function showViewportSize() {
        var the_width = $(window).width();
        var the_height = $(window).height();
        $('#width').text(the_width);
        $('#height').text(the_height);
    }
script>
<h1> h1>
<h2>  Width:h2>
<p id="width">Resize to find out!p>
<h2>  Height:h2>
<p id="height">Resize to find out!p>
body>
html>

좋은 웹페이지 즐겨찾기