jquery 获取浏览器窗口改变事件

$(window).resize(function() {  
var width = $(this).width();  
var height = $(this).height();  
//console.log('width'+width+'-height'+height);
}

必须写在加载完成后。

页面初始加载:

$(document).ready(function() { 

// 任何需要执行的js特效 
$("table tr:nth-child(even)").addClass("even"); 
}); 

猜你喜欢

转载自blog.csdn.net/qq_35226176/article/details/83894046