【问题标题】:ngx-gallery only showing medium size imagesngx-gallery 只显示中等大小的图像
【发布时间】:2018-08-21 02:03:13
【问题描述】:

我已经使用 angular ngx-gallery 构建了一个图片库。由于没有显示大小图像,因此我无法对工作做出响应。它只显示介质 大小的图像。

这是我的实现方式:

这些是选项:

this.galleryOptions = [
        {
            width: '100%',
            height: '254px',
            imageAutoPlay: true,
            imageAutoPlayPauseOnHover: true,
            imageSize: NgxGalleryImageSize.Contain,
            imageAnimation: NgxGalleryAnimation.Slide,
            thumbnails: false,
            preview: false
        },
        // max-width 544
        {
            breakpoint: 544,
            width: '100%',
            height: '250px',
            imageSwipe: true,
            imageArrowsAutoHide:true,
            imageAutoPlay: true,
            imageAutoPlayPauseOnHover: true,
            imageSize: NgxGalleryImageSize.Cover,
            imageAnimation: NgxGalleryAnimation.Slide,
            thumbnails: false,
            preview: false
        }
    ]; 

这是图像数组:(所有 url 已检查)

    this.galleryImages = [
        {
            small: 'assets/images/BannersResponsive/culturizate.jpg',
            medium: 'assets/images/Banners/radio_online_venezuela_fondo_demananacontigo.png',
            big: 'assets/images/BannersResponsive/culturizate.jpg'
        },
        {
            small: 'assets/images/BannersResponsive/culturizate.jpg',
            medium: 'assets/images/Banners/radio_online_venezuela_fondo_conexionyreflexion.png',
            big: 'assets/images/Banners/radio_online_venezuela_fondo_conexionyreflexion.png'
        }, ];

这是html:

<ngx-gallery class="gallery"                        
  [options]="galleryOptions                         
  [images]="galleryImages"></ngx-gallery>    

我还尝试将图像命名为相同的名称,并在名称的末尾加上 small、medium 和 big。

提前谢谢你。

【问题讨论】:

  • 我也有同样的问题,但仅限于 chrome。

标签: angularjs gallery image-gallery


【解决方案1】:

我的 css 中有:

.mat-sidenav-container, .mat-sidenav-content, .mat-tab-body-content { transform: none !important; }

在我删除它之后,所有尺寸的一切都正常。

【讨论】:

  • 嗨!感谢您发布。在你的组件 css 中?
  • 在我的情况下它在全局 css 文件中,但我想它也可能在组件 css 中。
猜你喜欢
  • 2019-11-11
  • 1970-01-01
  • 2022-07-26
  • 1970-01-01
  • 1970-01-01
  • 2020-05-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多