私はRailsプロジェクトでPhotoswipeとJustified Galleryを設定しました。両方とも非常にきれいに働いていますが、一緒に働くことに問題があります。私の現在の(デフォルト)では正当化されたギャラリーを使用したPhotoswipe
次のようにセットアップPhotoswipeは、タグの階層を期待:
<figure>
<a href="...>
<img src=".../>
</a>
詰めギャラリーがこのような範囲内のネストされた<img>
タグと<a>
タグの任意の数のコンテナを認識するようにデフォルトで設定され:
<div id="mygallery" >
<a href="...>
<img src=".../>
</a>
<a href="...>
<img src=".../>
</a>
<!-- other images... -->
</div>
だから私はその<figure>
タグを認識詰めギャラリーを持っている必要があります。その文書では、それはあなただけで、次のオプションを追加する必要が言う:
selector: 'figure, div:not(.spinner)'
この部分は正常に動作するようですが、また、CSSルールを拡張する必要があると私はこだわっているところであると述べています。私は、> figure
セレクタを持つ> a
セレクタの全部または一部をプリペンドすると、そのジョブを実行する必要がありますが、いいえと思っています。これらは、詰めギャラリーが付属してルールです:
.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;
}
私はかなりしばらくの間、これで遊んでてきたが、私はこの仕事をすることはできません。また、私はネット上で良い例を見つけることができませんでした。
誰でもこれを解決する方法を知っていますか?