ギャラリーは基本的にmouseover
上のノードのz-index
を高め、mouseout
でそれをリセットしています。
しかし、多分あなたはCSSのソリューションをチェックアウトしたい:
/* layout */
.stack { position: relative; }
.stack .item {
width: 320px;
height: 240px;
position: absolute;
}
/* and the effect */
.stack .item {
z-index: 1;
transition: z-index 86400s; /*24 hours*/
}
.stack:hover .item { z-index: auto; }
.stack .item:hover {
z-index: 2;
transition: z-index 0ms;
}
<div class="stack">
<div class="item" style="background: red; top: 0px; left: 0px;"></div>
<div class="item" style="background: green; top: 50px; left: 20px;"></div>
<div class="item" style="background: blue; top: 100px; left: 40px;"></div>
<div class="item" style="background: yellow; top: 150px; left: 60px;"></div>
</div>
これはかなり完璧な私の目的のためです。答える時間をとってくれてありがとう! – kineticnoise