Woocommerce店面 - 粘性产品页面图库

问题描述 投票:0回答:1

我正在使用Storefront,这是Woocommerce的'Woo'主题。我试图让图片库“粘”。目前仅包含1个项目。我的计划是将此项目向下滚动到我的网站上的产品页面描述/添加到购物车部分,这部分非常复杂和冗长。

我的网站目前还不在线,所以这里是店面演示:https://themes.woocommerce.com/storefront/product/lowepro-slingshot-edge-250-aw/

我从这里使用了Sticky的基本解释:https://www.w3schools.com/howto/howto_css_sticky_element.asp

并尝试应用它,逻辑上我想,就像这样

.woocommerce-product-gallery {
position: sticky!important;
top: 0!important;
}

这不起作用,所以我尝试针对其他各种元素:

woocommerce产品,gallery__wrapper

woocommerce产品,gallery__image

都没有工作。也许答案是扩展该画廊专栏的高度,但我想在不破坏店面画廊的正常功能的情况下这样做。重要的是我以后要添加多个图像。

如果有人能看到Storefront和Sticky项目的明显问题,请告诉我。谢谢。

css css3 woocommerce sticky storefront
1个回答
0
投票

答案来自http://dinbror.dk/blog/help-css-position-sticky-doesnt-work-solved/

Woocommerce(或者可能是Storefront)正文中有一些上面提到的溢出使用。

body.single-product,
body.single-product #page,
body.single-product .product {
overflow: visible!important;
}

因此,根据我原来的SO查询删除相关的溢出语句(上面的代码段为我工作)和Woocommerce / Storefront画廊'stick'。

解决。

© www.soinside.com 2019 - 2024. All rights reserved.