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     });

猜你喜欢

转载自www.cnblogs.com/guoliping/p/11112546.html