<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
</body>
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script>
$(window).bind("load resize",function(){
document.documentElement.clientWidth >= 600 ? console.log("hello") : console.log("xiaoyu600")
});
//第二种
$(window).bind("load resize",function(){
if(document.documentElement.clientWidth >= 600) console.log("hello111")
});
</script>
</html>