简体   繁体   English

CSS3动画样式的源代码

[英]Source code of a CSS3 animated style

Browsing the Handimania website I realised the title was pulsing one time when the mouse would hover it. 浏览Handimania网站时,我意识到标题会在鼠标悬停时跳动一次。 Now I know this could probably be a style-animation done with CSS or CSS3 (am I correct?) but I am not too sure about how I can see the source code. 现在,我知道这可能是使用CSS或CSS3完成的样式动画(我正确吗?),但是我不太确定如何查看源代码。

So far, when an appealing static webpage was popping in front of me I could just scan it's html in order to get its secrets and insights. 到目前为止,当一个吸引人的静态网页在我面前弹出时,我可以扫描它的html以获得其秘密和见解。 Now I find myself unable to approach this dynamic content in the same way. 现在,我发现自己无法以相同的方式处理这种动态内容。 What I can tell so far is that there should be, somwhere, a class called hover which in turn fades from 0% to 100% and back to 0% a cyano PNG title with a transparent background over a static grey image. 到目前为止,我可以说的是,在某个地方应该有一个名为hover的类,该类又会从0%渐变为100%,然后又回到0%,是带有静态灰色图像的透明背景的cyano PNG标题。

This is the furthest I can go 这是我能走的最远的地方

<div id="logo">
<img src="http://www.handimania.com/wp-content/themes/handimania/images/logo.png" alt="Handimania" class="hover"/>
<h1>
<img class="dark" src="http://www.handimania.com/wp-content/themes/handimania/images/logo-dark.png" alt="Handimania"/>
</h1>
<p id="tagline">Guides for Handmade, DIY &amp; Crafts Maniacs</p>
</div>

I think it's likely this piece of code: 我认为可能是这段代码:

$('#logo .hover').hover(
    function(e) {
        console.log('enter');
        $('#logo .hover').animate({opacity: 1}, "slow");
        $('#logo .dark').animate({opacity: 0}, "slow");
    },
    function(e) {
        console.log('leave')
        $('#logo .dark').animate({opacity: 1}, "slow");
        $('#logo .hover').animate({opacity: 0}, "slow");
    }
);

which is in the included file jquery.custom.js?ver=1.0 and shows that it's a jQuery animation, not a CSS3 animation. 包含在文件jquery.custom.js?ver=1.0中,它表明它是jQuery动画,而不是CSS3动画。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM