マスタースライダーを使用するときに問題があります。CSSの条件をチェックするには?
これは、多くのクラスを自動的に生成します。
私の場合は、ビデオと画像をスライドに読み込みます。私がチェックコードで
:私はボタンのコードでそれにプレー追加したい
div.ms-thumb-frame
div.ms-thumb video_slider
div.ms-thumb-ol
div.ms-thumb-frame
div.ms-thumb picture_slider
div.ms-thumb-ol
:
<?php if($item->type == 1): ?> <!-- is Video -->
<img class="ms-thumb video_slider" ... />
?>
<?php if($item->type == 2): ?> <!-- is Picture -->
<img class="ms-thumb picture_slider" ... />
<div class="picturediv"></div> <!-- I tried to add manual element like that to assign instead of using: `ms-thumb-ol` but it auto remove when slide is generate -->
?>
それは、このような構造を生成します
div.ms-thumb-frame {
position: relative;
}
div.ms-thumb-frame div.ms-thumb-ol {
position: absolute;
display: block;
background: url(http://www.workbooks.com/sites/default/files/image/play-button-crm-homepage2.png);
height: 55px;
width: 57px;
top: 0;
left:0;
right:0;
bottom:0;
margin:auto;
}
div.ms-thumb-frame div.ms-thumb-ol:hover {
background: url(http://www.workbooks.com/sites/default/files/image/play-button-crm-homepage-11.png);
}
あなたは、私は要素ms-thumb-ol
だけをスタイルすることがわかります。
この要素は他の要素と同じです。
することで、アイテムの2種類のみを持っている場合はdiv.ms-thumb picture_slider
とdiv.ms-thumb-ol
同時
あなたはCSSの条件を適用する場合は、サスを利用することができます。 –
JavaScriptまたはCSSまたはPHPを使用することを意味しますか? * "div.ms- thumb picture_sliderとdiv.ms-thumb-ol concurrent" *あなたは、いつ..olがスライダーの後に来るかをチェックしたいのですか? – Alvaro
これは、兄弟の '+'コンビネータを使ってCSSだけで行うことができます。私の答えをチェックしてください。 –