我被指派以一种自定义的方式显示旋转木马。我不确定这是否可能。有什么需要帮忙的..。
https://stackblitz.com/edit/primeng-carousel-demo-vytqod
在现有代码中,屏幕如下所示(根据屏幕大小显示一个或两个或三个图像)。
但要求在中心显示一个图像,其他图像(即左和右)显示30%,如下所示
发布于 2021-02-10 05:57:08
对不起,我没有什么包裹要给你。但我做了一些看起来像你需要的东西。
下面是the Stackblitz,下面是我为获得此视图而添加的css代码:
.p-carousel-container {
width: 70% !important;
margin: auto;
}
.p-carousel-items-content {
overflow: visible !important;
width: 70% !important; /* adapt this to show more/less of the sided items, but it should be the same % than for the p-carousel-container above */
}
.p-carousel-prev {
z-index: 9999;
}
/* https://www.w3schools.com/howto/howto_css_hide_scrollbars.asp */
/* Hide scrollbar for Chrome, Safari and Opera */
.p-carousel-content::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.p-carousel-content {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
我希望它能满足你的需要。我没有设法将这些修改限制在小屏幕上,我会让你来处理的。要进行测试,您只需缩短stackblitz集成浏览器即可。
https://stackoverflow.com/questions/66126129
复制相似问题