Kann mir bitte jemand mit CSS Animation helfen? Mb sollte ich auch js verwenden? Ich möchte Hover Animation links -> rechts erstellen, aber nach dem Verlassen der Maus, möchte ich die Animation links -> rechts nicht rechts -> links fortsetzen.CSS Animation nach Mausklick fortsetzen
Dank
.button_sliding_bg {
color: #31302B;
background: #FFF;
padding: 12px 17px;
margin: 25px;
font-family: 'OpenSansBold', sans-serif;
border: 3px solid #31302B;
font-size: 14px;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
border-radius: 2px;
display: inline-block;
text-align: center;
cursor: pointer;
box-shadow: inset 0 0 0 0 #31302B;
\t -webkit-transition: all ease 0.8s;
\t -moz-transition: all ease 0.8s;
\t transition: all ease 0.8s;
}
.button_sliding_bg:hover {
box-shadow: inset 100px 0 0 0 #31302B;
color: #FFF;
}
<button class="button_sliding_bg">
Button
</button>
ich so etwas wie dies wollen:
Hier ist die Lösung:
window.setTimeout(function() {
document.getElementById('btn').style.visibility = 'visible';
}, 400);
.button_sliding_bg {
visibility:hidden;
padding: 12px 17px;
margin: 25px;
font-family: 'OpenSansBold', sans-serif;
border: 3px solid #31302B;
font-size: 14px;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
border-radius: 2px;
display: inline-block;
text-align: center;
cursor: pointer;
animation: animate-out 0.5s 1;
\t animation-fill-mode:forwards;
}
.button_sliding_bg:hover {
animation: animate-in 0.5s 1;
\t animation-fill-mode:forwards;
}
@keyframes animate-in {
\t 0% {
\t \t box-shadow: inset 0 0 0 0 #31302B;
\t \t color:#31302B;
\t background: #FFF;
\t }
\t 100% {
\t \t box-shadow: inset 100px 0 0 0 #31302B;
\t \t color:#FFF;
\t background: #FFF;
\t }
}
@keyframes animate-out {
\t 0% {
\t \t box-shadow: inset 0 0 0 0 #FFF; \t
\t background: #31302B;
\t \t color:#FFF;
\t }
\t 100% {
\t \t box-shadow: inset 100px 0 0 0 #FFF; \t
\t background: #31302B;
\t \t color:#31302B;
\t }
}
<button id="btn" class="button_sliding_bg">
Button
</button>
Bitte senden Sie den Code von dem, was Sie versucht haben. –
Ich habe gerade den Code hinzugefügt, den ich verwende. –
Möchten Sie diesen Effekt auf Knopf aus Ihrem Beispiel oder auf Text (um 'transparenten Text' zu machen), genau wie auf .gif? – sinisake