我正在尝试添加具有 Webgl 悬停效果的图像。效果 id 有效,但是,我现在正在尝试为 jQuery 中的图像设置宽度,
new hoverEffect({
parent: document.querySelector('.ticket'),
intensity1: 0.1,
intensity2: 0.1,
angle2: Math.PI / 2,
image1: 'https://source.unsplash.com/Le7_qK9JaLU/500x500',
image2: 'https://source.unsplash.com/XAqaeyzj3NM/500x500',
displacementImage: 'https://cdn.rawgit.com/robin-dela/hover-effect/b6c6fd26/images/stripe1mul.png?raw=true'
});
.ticket{
width: 100%;
height: 100%;
position: absolute;
background: black;
}
最佳答案
如果想使用 jquery 设置图像的宽度。 只需添加这一行
示例
$(".img1").css({ 'height': '200px', 'width': '210px' });
关于javascript - 如何设置jQuery中图像的宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53164395/