停止在智能手机上滚动时消除“图像缩放”效果

时间:2018-12-24 20:00:29

标签: css wordpress woocommerce image-zoom

my site上点击图像时,woo图像缩放效果出现问题。当在智能手机上滚动都可以,但是在产品缩略图上点击时,图像为缩放状态,并且不会以全尺寸显示。我只想将其删除到智能手机外观中。例如,这里显示了问题:

issue on smartphone

我尝试通过CSS修复此问题,但未成功。这是图片部分的CSS:

.et_overlay {
display: block;
position: absolute;
z-index: -1;
top: 0;
left: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
height: 100%;
border: 1px solid #e5e5e5;
opacity: 0;
background: rgba(255,255,255,.9);
-webkit-transition: all .3s;
-moz-transition: all .3s;
transition: all .3s;
-webkit-transform: translate3d(0,0,0);
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-o-backface-visibility: hidden
}

.et_overlay:before {
position: absolute;
top: 55%;
left: 50%;
margin: -16px 0 0 -16px;
font-size: 32px;
content: "\e050";
-webkit-transition: all .4s;
-moz-transition: all .4s;
transition: all .4s
}

编辑:也尝试了此功能,但没有成功:

function remove_image_zoom_support() {
remove_theme_support( 'wc-product-gallery-zoom' );
}
add_action( 'wp', 'remove_image_zoom_support', 100 );

任何帮助该如何解决?谢谢

1 个答案:

答案 0 :(得分:0)

好像添加了此CSS,从智能手机上的Woo thumb中删除了缩放功能:

.et_shop_image {
pointer-events:none!important;
}