<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <!-- viewport 是对移动端适口 优化 --> <meta name="format-detection" content="telephone=no"> <title>文字</title> <link rel="shortcut icon" href="image/favicon.png"><!-- 网站图标 --> <link href="../../css/index.css" rel="stylesheet"> </head> <style> .ss{} </style> <body> <div class="container"></div> </body> </html> <script type="text/javascript" src="../../js/jquery-2.1.4.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ alert($(window).width()) }); $(function(){ $(window).resize(function(){ alert($(window).width()); }) }) </script>