這正常工作,因爲它應該當它涉及到的淡入/出部分然而h1
孩子作爲一個href
標籤大幹快上hover
刪除 - 我想保留一個標記。
這也會導致-webkit-text-fill-color:transparent; -webkit-background-clip:text;所以如果我會爲一個標籤設置動畫效果,會導致一個跳動的動畫(chrome)。但是我發現,如果我的動畫父是H1動畫平穩運行
結構應該是:
<div id="heroburrito">
<div class="vert">
<h1>
<a class="homehover" href="#"></a> <!--This parts gets removed on hover - it shouldn't-->
</h1>
</div>
</div>
JS
$('#heroburrito .vert h1 a.homehover').attr('data-originalText', function() {
return (this.textContent || this.innerText).trim();
}).hover(function() {
$(this).fadeOut(660, function() {
$(this).text('←retreat').fadeIn().addClass('home').idle(200);
});
},
function() {
$(this).fadeOut(660, function() {
$(this).text($(this).attr('data-originalText')).fadeIn().removeClass('home');
});
});
這是實現CSS的一種奇怪的方式。如果你設置了class或id,然後將css放入css框中,它會更快更容易查看。 – 2013-07-18 15:36:11
@OliverCole對不起,這是直接從我正在做的WP主題開始的。我在哪裏使用PHP控制CSS - 檢查這個鏈接http://sebastiangraz.com/projects/portfolio/?portfolio=konsthallen –
這不是奇怪的方式@Oliver,它是其中一種方式(內聯樣式)。唯一的好處是它們具有最高優先級,這些樣式無論如何都會被應用。 – Learner