jquery如何监听浏览器窗口大小并根据不同的大小输出不同的值

1 $(window).bind("load resize",function(){
2     document.documentElement.clientWidth >= 600 ? console.log("hello") : console.log("xiaoyu600")
3     });
4     //第二种
5     $(window).bind("load resize",function(){
6      if(document.documentElement.clientWidth >= 600) console.log("hello111")
7     });

 

posted @ 2019-07-01 10:08  Gordon-Guo  阅读(1388)  评论(0编辑  收藏  举报