Angular 和 ng-image-slider - 一次只显示一张图片
Angular and ng-image-slider - show only one image a time
我在我的应用程序中使用 ng-image-slider 滑动图像。
除了更改“imageSize”输入和播放图像外,如何控制只显示一张图像width/height。我希望它能够响应。
这是我的代码-
<ng-image-slider
[images]="imageObject"
[infinite]="true"
[showArrow]="false"
[autoSlide]="1">
</ng-image-slider>
谢谢!
看起来显示的图像数量完全取决于包含的滑块元素的大小,这意味着您需要知道图像滑块将占用的大小,并使 imageSize 适合整个 space (或使用 space
属性)。
如果您选择使图像的宽度占据整个 space,请确保将 space
属性 设为 0,或者在设置宽度
由于宽度是固定的并且图像可能有不同的 width:height 比率,我建议使用 manageImageRatio
将其设置为 true
这里是 Stackblitz example 图像填满了整个宽度。
我在我的应用程序中使用 ng-image-slider 滑动图像。 除了更改“imageSize”输入和播放图像外,如何控制只显示一张图像width/height。我希望它能够响应。
这是我的代码-
<ng-image-slider
[images]="imageObject"
[infinite]="true"
[showArrow]="false"
[autoSlide]="1">
</ng-image-slider>
谢谢!
看起来显示的图像数量完全取决于包含的滑块元素的大小,这意味着您需要知道图像滑块将占用的大小,并使 imageSize 适合整个 space (或使用 space
属性)。
如果您选择使图像的宽度占据整个 space,请确保将 space
属性 设为 0,或者在设置宽度
由于宽度是固定的并且图像可能有不同的 width:height 比率,我建议使用 manageImageRatio
将其设置为 true
这里是 Stackblitz example 图像填满了整个宽度。