Css 带对齐库的Photosweep

Css 带对齐库的Photosweep,css,ruby-on-rails,image-gallery,photoswipe,Css,Ruby On Rails,Image Gallery,Photoswipe,我在Rails项目中成功地设置了和。他们两个单独工作都很好,但我很难让他们一起工作 在我当前的(默认)设置中,Photosweep需要一个标记层次结构,如下所示: <figure> <a href="...> <img src=".../> </a> 这一部分似乎工作得很好,但也提到了扩展CSS规则的必要性,这正是我被卡住的地方。我希望在所有或部分>选择器前面加上>图选择器可以完成这项工作,但不可以。以下是示例库附带的规则: se

我在Rails项目中成功地设置了和。他们两个单独工作都很好,但我很难让他们一起工作

在我当前的(默认)设置中,Photosweep需要一个标记层次结构,如下所示:

<figure>
  <a href="...>
    <img src=".../>
  </a>
这一部分似乎工作得很好,但也提到了扩展CSS规则的必要性,这正是我被卡住的地方。我希望在所有或部分
>选择器前面加上
>图
选择器可以完成这项工作,但不可以。以下是示例库附带的规则:

selector: 'figure, div:not(.spinner)'
我已经玩了很长一段时间了,但我不能让这个工作。我也没有在网上找到一个好的例子


以前有人这样做过,或者知道如何解决吗?

我通过使用以下方法解决了这个问题:

.justified-gallery {
  width: 100%;
  position: relative;
  overflow: hidden;
}
.justified-gallery > a,
.justified-gallery > div {
  position: absolute;
  display: inline-block;
  overflow: hidden;
  opacity: 0;
  filter: alpha(opacity=0);
  /* IE8 or Earlier */
}
.justified-gallery > a > img,
.justified-gallery > div > img,
.justified-gallery > a > a > img,
.justified-gallery > div > a > img {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 0;
  border: none;
}
.justified-gallery > a > .caption,
.justified-gallery > div > .caption {
  display: none;
  position: absolute;
  bottom: 0;
  padding: 5px;
  background-color: #000000;
  left: 0;
  right: 0;
  margin: 0;
  color: white;
  font-size: 12px;
  font-weight: 300;
  font-family: sans-serif;
}
.justified-gallery > a > .caption.caption-visible,
.justified-gallery > div > .caption.caption-visible {
  display: initial;
  opacity: 0.7;
  filter: "alpha(opacity=70)";
  /* IE8 or Earlier */
  -webkit-animation: justified-gallery-show-caption-animation 500ms 0 ease;
  -moz-animation: justified-gallery-show-caption-animation 500ms 0 ease;
  -ms-animation: justified-gallery-show-caption-animation 500ms 0 ease;
}
.justified-gallery > .entry-visible {
  opacity: 1.0;
  filter: alpha(opacity=100);
  /* IE8 or Earlier */
  -webkit-animation: justified-gallery-show-entry-animation 500ms 0 ease;
  -moz-animation: justified-gallery-show-entry-animation 500ms 0 ease;
  -ms-animation: justified-gallery-show-entry-animation 500ms 0 ease;
}
.justified-gallery > .jg-filtered {
  display: none;
}
.justified-gallery > .spinner {
  position: absolute;
  bottom: 0;
  margin-left: -24px;
  padding: 10px 0 10px 0;
  left: 50%;
  opacity: initial;
  filter: initial;
  overflow: initial;
}
.justified-gallery > .spinner > span {
  display: inline-block;
  opacity: 0;
  filter: alpha(opacity=0);
  /* IE8 or Earlier */
  width: 8px;
  height: 8px;
  margin: 0 4px 0 4px;
  background-color: #000;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 6px;
}
在选项中,将css中的所有
div
选择器替换为
。所以

selector: 'a, figure:not(.spinner)'
将成为:

.justified-gallery > div > img,

我通过以下方法解决了这个问题:

.justified-gallery {
  width: 100%;
  position: relative;
  overflow: hidden;
}
.justified-gallery > a,
.justified-gallery > div {
  position: absolute;
  display: inline-block;
  overflow: hidden;
  opacity: 0;
  filter: alpha(opacity=0);
  /* IE8 or Earlier */
}
.justified-gallery > a > img,
.justified-gallery > div > img,
.justified-gallery > a > a > img,
.justified-gallery > div > a > img {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  padding: 0;
  border: none;
}
.justified-gallery > a > .caption,
.justified-gallery > div > .caption {
  display: none;
  position: absolute;
  bottom: 0;
  padding: 5px;
  background-color: #000000;
  left: 0;
  right: 0;
  margin: 0;
  color: white;
  font-size: 12px;
  font-weight: 300;
  font-family: sans-serif;
}
.justified-gallery > a > .caption.caption-visible,
.justified-gallery > div > .caption.caption-visible {
  display: initial;
  opacity: 0.7;
  filter: "alpha(opacity=70)";
  /* IE8 or Earlier */
  -webkit-animation: justified-gallery-show-caption-animation 500ms 0 ease;
  -moz-animation: justified-gallery-show-caption-animation 500ms 0 ease;
  -ms-animation: justified-gallery-show-caption-animation 500ms 0 ease;
}
.justified-gallery > .entry-visible {
  opacity: 1.0;
  filter: alpha(opacity=100);
  /* IE8 or Earlier */
  -webkit-animation: justified-gallery-show-entry-animation 500ms 0 ease;
  -moz-animation: justified-gallery-show-entry-animation 500ms 0 ease;
  -ms-animation: justified-gallery-show-entry-animation 500ms 0 ease;
}
.justified-gallery > .jg-filtered {
  display: none;
}
.justified-gallery > .spinner {
  position: absolute;
  bottom: 0;
  margin-left: -24px;
  padding: 10px 0 10px 0;
  left: 50%;
  opacity: initial;
  filter: initial;
  overflow: initial;
}
.justified-gallery > .spinner > span {
  display: inline-block;
  opacity: 0;
  filter: alpha(opacity=0);
  /* IE8 or Earlier */
  width: 8px;
  height: 8px;
  margin: 0 4px 0 4px;
  background-color: #000;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 6px;
}
在选项中,将css中的所有
div
选择器替换为
。所以

selector: 'a, figure:not(.spinner)'
将成为:

.justified-gallery > div > img,

使用Arrized Gallery v3.7.0和Photosweep v4.1.3,只需将默认选择器替换为

.justified-gallery > figure > img,
因此,对于
可以得到:

'figure, > div:not(.spinner)'

使用Arrized Gallery v3.7.0和Photosweep v4.1.3,只需将默认选择器替换为

.justified-gallery > figure > img,
因此,对于
可以得到:

'figure, > div:not(.spinner)'