<img>当屏幕尺寸变为 1199px 时,这是我的标签:
<img id='rotateimage' src='images/01/0001.jpg' width='1200' height='700'>
我想改变宽度和高度,例如:width: 1000; height:500当屏幕尺寸变为1199px时减小宽度和高度。
这是正在做的事情,但它不起作用:
if ($screen_width <= 1199){
$width2 = 1000;
$height = 500;
}
$("img").attr('width', '$width2');
$("img").attr('height', '$height');