在窗口对象上使用resize事件:
$(window).resize(function(){
var width = $(document).width(), // or $(window).width()
height = $(document).height(); // or $(window).height()
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6712 次 |
| 最近记录: |