我的 html 页面中有一张图片。
<img src="http://s3-media1.ak.yelpcdn.com/bphoto/sMONYSiLUQEvooJ5hZh0Sw/l.jpg" alt="" width="200" height="150">
如何通过单击在同一页面中放大显示它?
最佳答案
我想这对你有帮助
<img src="http://s3-media1.ak.yelpcdn.com/bphoto/sMONYSiLUQEvooJ5hZh0Sw/l.jpg" class="img" alt="" width="200" height="150">
.img:hover{
color: #424242;
-webkit-transition: all .3s ease-in;
-moz-transition: all .3s ease-in;
-ms-transition: all .3s ease-in;
-o-transition: all .3s ease-in;
transition: all .3s ease-in;
opacity: 1;
transform: scale(1.15);
-ms-transform: scale(1.15); /* IE 9 */
-webkit-transform: scale(1.15); /* Safari and Chrome */
}
您可以根据自己的需要转换 Scale。
关于javascript - 如何通过单击展开 HTML 中的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19104018/