對於一個藝術家的網站,圖片完全填充瀏覽器窗口,我想顯示一條縮略圖,它將消失,只留下當前圖像的縮略圖。當您將鼠標滑過此縮略圖時,縮略圖條會再次出現,以便您可以選擇新圖片。強制完成CSS動畫
我已經在下面包含了該效果的模型,並且您可以在其中看到這個效果的jsFiddle。
如果將鼠標滑過縮略圖然後再次快速關閉,動畫將停止,保持暫停狀態1秒,然後反轉。我應該如何改變CSS,以便滑出動畫一旦啓動就會一直播放到最後?
<html>
<head>
<style>
html, body {
height: 100%;
margin:0;
overflow: hidden;
}
div {
position:absolute;
left:0;
width: 100px
}
#cue, #thumb {
bottom:0;
height:50px;
}
#cue, #thumb {
bottom:0;
height:50px;
}
#cue {
background: none;
opacity: 0.2;
z-index: 2;
}
#thumb {
background: blue;
opacity: 0.5;
}
#strip {
background: blue;
opacity: 0.2;
z-index:1;
height: 99%;
top: 100%;
-webkit-transition: all 500ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
-moz-transition: all 500ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
-o-transition: all 500ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
transition: all 500ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
-webkit-transition-delay: 1s;
transition-delay: 1s;
}
#cue:hover + #strip, #strip:hover {
top: 1%;
-webkit-transition-delay: 0s;
transition-delay: 0s;
}
#thumb {
-webkit-transition: all 300ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
-moz-transition: all 300ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
-o-transition: all 300ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
transition: all 300ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
-webkit-transition-delay: 1200ms;
transition-delay: 1200ms;
}
#cue:hover ~ #thumb, #strip:hover+#thumb {
opacity: 0;
-webkit-transition-delay: 0s;
transition-delay: 0s;
}
</style>
</head>
<div id="cue"></div>
<div id="strip"></div>
<div id="thumb"></div>
</html>