【问题标题】:Adding title tags to each image in the grid view using ngx-crystal-gallary使用 ngx-crystal-gallery 为网格视图中的每个图像添加标题标签
【发布时间】:2021-02-16 19:03:57
【问题描述】:

有没有办法使用 ngx-crystal-gallary

为网格视图中的每个图像添加标题标签
 <crystal-gallery [images]="selectedFolder.imageUrlsWithPreview" [config]="myConfig">
  </crystal-gallery>

【问题讨论】:

  • 你的问题不清楚。请附上您的部分代码并明确您想要什么以及您是如何尝试解决的
  • 每张图片一个标题,还是每张图片多个标签?
  • 每张图片一个标题标签
  • description: 'title of the image' 属性应该为您完成这项工作

标签: angular ngx-gallery


【解决方案1】:
myImages = [
    {
        preview: 'path_to_preview',
        full: 'path_to_full_image',
        width: natural_width, // used for masonry
        height: natural_height // used for masonry
        description: '<description/title of the image>' // optional property
    },
    ...
myConfig = {
    ...
};
];
<crystal-gallery [images]="myImages" [config]="myConfig"></crystal-gallery>

结果:

更新:

对于您的特定用例,ngx-crystal-gallery 不支持图像网格上的标题。

替代方案: 使用ng-image-slider

【讨论】:

  • 我希望这个标题标签在网格视图中而不是在灯箱中
  • 根据他们的文档,库不支持,您可以使用:github.com/sanjayV/ng-image-slider
  • 它比 ngx-crystal-gallery 更活跃(最后一次提交是 3 年 vs 6 个月)
猜你喜欢
  • 2012-11-15
  • 1970-01-01
  • 1970-01-01
  • 2011-09-02
  • 2020-09-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-08
相关资源
最近更新 更多