gpt4 book ai didi

html - IE中旋转图片的宽度问题

转载 作者:行者123 更新时间:2023-11-28 18:34:52 26 4
gpt4 key购买 nike

我写了下面的代码。需要在 IE 版本上运行,所以使用过滤器进行轮换。多次单击该按钮,将更新图像的宽度,并重新定位图像。

我们将不胜感激。

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Zoom Issue</title>

<style>
.ImgClass{
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
height : auto;
width : 100%;

}
.divClass{
width : 800px;
height : 750px;
}

</style>
</head>

<SCRIPT type="text/javascript">
function zoomImage(){
document.getElementById('myImage').style.width = document.getElementById('myImage').offsetWidth * 1.5;
}
</SCRIPT>

<body>
<input type="button" id='btnClick' value='Click' onClick="zoomImage();"/>
<DIV class='divClass'>
<IMG class='ImgClass' id='myImage' src='Image.jpg' />
</DIV>

</body>
</html>

最佳答案

在我看来,您似乎在更改错误的维度。如果你在它的侧面旋转它,宽度变成高度,高度变成宽度(除非你把头放在它的侧面):

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Zoom Issue</title>
<style>
.ImgClass{
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
height : 100%;
width : auto;
}
.divClass{
width : 800px;
height : 750px;
}
</style>
</head>

<SCRIPT type="text/javascript">
function zoomImage(){
var img = document.getElementById('myImage');
img.style.height = e1.offsetHeight * 1.5 + "px";
}
</SCRIPT>

<body>
<input type="button" id='btnClick' value='Click' onClick="zoomImage();"/>
<DIV class='divClass'>
<img class='ImgClass' id='myImage' src="Images/IMG_6686.JPG">
</DIV>
</body>
</html>

这对我来说在 IE8 中似乎工作正常。

关于html - IE中旋转图片的宽度问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13070094/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com