我有使用css創建的動畫的問題。一切工作正常,我只需要完成此設置和設置輸入類型來重置動畫。CSS - 重置動畫
這裏是我的CSS,這應該重置動畫:
$('button').on('click', function(){
var heading = $('h1').clone().removeClass();
$('h1').remove();
$('header').append(heading);
$('h1').addClass('fadein_element');
});
CSS動畫
@keyframes fadein {
0% { opacity: 0; }
100% { opacity: 1; }
enter code here
.fadein{-webkit-animation: fadein 3s ease-in ;
-moz-animation: fadein 3s ease-in ;
animation: fadein 3s ease-in ;
這是我的一部分基本的html:
<input type="radio" name="radio-set" checked="checked" id="st-control-1"/>
<a href="#st-panel-1">WebGear</a>
,這裏是原來的版本:
input type="radio" name="radio-set" checked="checked" id="st-control-1"/>
<a href="#st-panel-1"><h1 class="fadein_element"><button class="fadein_element">WebGear</button></h1></a>
我得到了它,並沒有丟失重置動畫。除此之外,它工作正常。總結起來,你們有什麼想法如何得到這個工作?最好使用默認的html代碼...
編輯:發佈最小碼至極,我試圖讓工作
</head>
<body>
<div class="st-container">
<input type="radio" name="radio-set" checked="checked" id="st-control-1"/>
<a href="#st-panel-1">Something</a>
<input type="radio" name="radio-set" id="st-control-2"/>
<a href="#st-panel-2">Happiness</a>
<input type="radio" name="radio-set" id="st-control-3"/>
<a href="#st-panel-3">Tranquillity</a>
<input type="radio" name="radio-set" id="st-control-4"/>
<a href="#st-panel-4">Positivity</a>
<input type="radio" name="radio-set" id="st-control-5"/>
<a href="#st-panel-5"> WebGear</a>
<div class="st-scroll">
<section class="st-panel" id="st-panel-5">
<div class="st-deco" data-icon="H"></div>
<div id="section1">
<div id="menu"> <img id="menuitem" src="Images/Menuitem.png"/>
<div id="hlava">
<div id="flashContent">
---Here goes the content---
There are just closing tags
和CSS
@keyframes fadein {
0% { opacity: 0; }
100% { opacity: 1; }
}
.fadein{-webkit-animation: fadein 3s ease-in ;
-moz-animation: fadein 3s ease-in ;
animation: fadein 3s ease-in ;
當我點擊「單選按鈕「我希望我的(在這種情況下是st-panel-5)重置動畫。這5個按鈕中的任何一個都可以做到這一點,所以我相信我可以將它應用到st級的面板上。
後最小工作代碼片段重現問題 – LGSon