2

したがって、画像の下にある :before を持つ純粋に文体的な div があり、css は次のようになります。

.the-image-div {
    width: 100px;
    height: 100px;
    box-shadow: inset 0px 0px 3px white;
    border: 1px gray solid;
    position: relative;
    z-index: 3;
}

.image-stack {
    width: 100px;
    height: 100px;
    background: white;
    border: 1px solid gray;
    position: relative;
    top:3px;
    left: 3px;
    z-index: 2;
}

.image-stack:before {
    content: " ";
    width: 100px;
    height: 100px;
    background: white;
    border: 1px solid gray;
    box-shadow: inset 0px 0px 1px white;
    position: absolute;
    top: 3px;
    left: 3px;
    z-index: 1;
}

イメージ スタックだけでなく、:before も個別に jquery で選択できるようにするとよいでしょう。目標は、画像スタック自体の数ミリ秒後にフェードすることです。アイデア?

4

1 に答える 1

3

JavaScript は疑似要素と対話できません。代わりに、後で要素に追加されるクラスに :before を適用し、CSS トランジションを使用してフェードインさせます。

于 2013-01-03T18:33:01.033 に答える