嗨,有人可以帮助我,我做错了什么..? 这是我的for循环,但它不起作用..
$(document).ready(function() {
for (h = 1; h <= 4 h++) {
var matchlinestatic = $('#matchline-static' + h).height();
var matchlinedynamic = $('#matchline-dynamic' + h).height();
console.log(matchlinestatic);
console.log(matchlinedynamic);
var result = Math.max(matchlinestatic, matchlinedynamic);
var result = result + 'px';
$("#matchline-static" + h).css('height', result);
$("#matchline-dynamic" + h).css('height', result);
console.log(result);
}
});
答案 0 :(得分:3)
错字,分号丢失,您也可以添加声明:
for (var h = 1; h <= 4; h++) {
^^^ ^