Javascript 自举图像缩放
我正在做一个电子商务网站。我正在使用引导。在执行产品详细信息页面时,我应该使用什么?我希望它是这样的Javascript 自举图像缩放,javascript,jquery,asp.net,angular-ui-bootstrap,zooming,Javascript,Jquery,Asp.net,Angular Ui Bootstrap,Zooming,我正在做一个电子商务网站。我正在使用引导。在执行产品详细信息页面时,我应该使用什么?我希望它是这样的 我希望在图片方面图片能够增长。这里我有一些代码,可以帮助您使用纯CSS增长图像 CSS HTML 演示 以下是一个工作示例 这是html <p>Background image:</p> <div class="zoom-bg"></div> <p>Using nested image and <co
我希望在图片方面图片能够增长。这里我有一些代码,可以帮助您使用纯CSS增长图像 CSS HTML
演示
以下是一个工作示例 这是
html
<p>Background image:</p>
<div class="zoom-bg"></div>
<p>Using nested image and <code>object-fit</code>:</p>
<div class="zoom-img">
<img src="https://placeimg.com/300/200/arch">
</div>
这是css
.zoom-bg {
width: 300px;
height: 200px;
overflow: hidden;
}
.zoom-bg:before {
content: '';
display: block;
width: 100%;
height: 100%;
background: url(https://placeimg.com/300/200/nature) no-repeat center;
background-size: cover;
transition: all .3s ease-in-out;
}
.zoom-bg:hover:before {
transform: scale(1.2);
}
.zoom-img {
width: 300px;
height: 200px;
overflow: hidden;
}
.zoom-img > img {
object-fit: cover;
width: 100%;
height: 100%;
transition: all .3s ease-in-out;
}
.zoom-img:hover > img {
transform: scale(1.2);
}
检查中的工作示例,图像应为2格式。我是说,一个小尺寸的指甲。还有一个大的。单击小图像,即图像的
缩略图
,需要显示大图像。要实现这一点,还需要Jquery和CSS。请搜索,是否有Jquery插件可以执行此操作。
<p>Background image:</p>
<div class="zoom-bg"></div>
<p>Using nested image and <code>object-fit</code>:</p>
<div class="zoom-img">
<img src="https://placeimg.com/300/200/arch">
</div>
.zoom-bg {
width: 300px;
height: 200px;
overflow: hidden;
}
.zoom-bg:before {
content: '';
display: block;
width: 100%;
height: 100%;
background: url(https://placeimg.com/300/200/nature) no-repeat center;
background-size: cover;
transition: all .3s ease-in-out;
}
.zoom-bg:hover:before {
transform: scale(1.2);
}
.zoom-img {
width: 300px;
height: 200px;
overflow: hidden;
}
.zoom-img > img {
object-fit: cover;
width: 100%;
height: 100%;
transition: all .3s ease-in-out;
}
.zoom-img:hover > img {
transform: scale(1.2);
}