当窗口宽度小于1200px时,我正在使用这个JQuery将div设置为与另一个相同的宽度,并且无法弄清楚我正在制造什么错误.
var width = $('.creative').outerWidth();
if ($(window).width() < 1200){
$('#right-child').css('width', width);
}else{
console.log('more than 1200');
};
Run Code Online (Sandbox Code Playgroud)