如何设置jQuery中图像的宽度



我正在尝试添加一个具有Webgl悬停效果的图像。效果是有效的,但是,我现在正试图为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' });

最新更新