$(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");
});