分类
代码

wordpress的logo晃动代码

首先你的主题得支持logo显示

然后找到输出logo的代码

比如:


1
2
3
4
5
6
7
8
if (git_get_option('git_piclogo_b')) { ?><?php
    if (git_get_option('git_customlogo')) { ?><img src="<?php
        echo git_get_option('git_customlogo'); ?>"><?php
    } ?><?php
    if (!git_get_option('git_customlogo')) { ?><img src="<?php
        bloginfo('template_url'); ?>/img/logo.png"><?php
    } ?><?php
}

修改后如下


1
2
3
4
5
6
7
8
9
10
11
if (git_get_option('git_piclogo_b')) { ?><?php
    if (git_get_option('git_customlogo')) { ?><img alt="<?php
        bloginfo('name'); ?>" src="<?php
        echo git_get_option('git_customlogo'); ?>"><?php
    } ?><?php
    if (!git_get_option('git_customlogo')) { ?><link href="<?php
        bloginfo('template_url'); ?>/logo.css" rel="stylesheet" type="text/css"><div id="hd"><h2><img alt="<?php
        bloginfo('name'); ?>" src="<?php
        bloginfo('template_url'); ?>/img/logo.png"></h2></div><?php
    } ?><?php
}

从代码中可以看出必须连接到logo.css

css部分代码如下


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#hd h2{animation-duration:0.4s;-webkit-animation-duration:0.4s;anim
ation-name:afastr;-webkit-animation-name:afastr;}
#um,#toptb,.pns{animation-duration:1s;-webkit-animation-duration:1s;an
imation-name:afastr;-webkit-animation-name:afastr;}
#hd h2{transition:all .15s ease-out;-webkit-transition:all .15s ease-o
ut;-moz-transition:all .15s ease-out;-o-transition:all .15s

ease-out;}
#hd h2:hover{transform:scale(1.07) rotate(-1deg);-webkit-transform:sca
le(1.07) rotate(-1deg);-moz-transform:scale(1.07) rotate(-

1deg);-o-transform:scale(1.07) rotate(-1deg);}
.avt{transition:all .15s ease-out;-webkit-transition:all .15s ease-out
;-moz-transition:all .15s ease-out;-o-transition:all .15s

ease-out;}
.avt:hover{transform:scale(1.07);-webkit-transform:scale(1.07);-moz-tr
ansform:scale(1.07);-o-transform:scale(1.07);}

发表评论

您的电子邮箱地址不会被公开。