首页 > Web开发 > 详细

周日的html学习

时间:2019-12-01 14:17:37      阅读:61      评论:0      收藏:0      [点我收藏+]

总结一下目前学习的CSS动画:
过渡动画:可通过hover触发,格式如下

transition: property duration timing-function delay;
    property定义应用该特性的属性名,如宽度width
    duration定义动画时长,如.2s或2ms
    timing-function定义动画模式,linear ease ease-in-out常用,自定义可以用cubic-bezic(p1,p2,p3,p4)定义贝塞尔曲线
    delay定义延迟一段时间播放

动画:animation以及@keyframes
@keyframes规定动画的关键帧,进度以%表示

@keyframes myfirst
{
0%   {background: red; left:0px; top:0px;}
25%  {background: yellow; left:200px; top:0px;}
50%  {background: blue; left:200px; top:200px;}
75%  {background: green; left:0px; top:200px;}
100% {background: red; left:0px; top:0px;}
}

animation类似transition

animation: name duration timing-function delay iteration-count direction;
    iteration-count定义播放次数
    direction定义是否正反向轮播
例子:
    animation: myfirst 5s linear 2s infinite alternate;
额外属性:
    animation-play-state:paused;定义是否播放,可以实现暂停
    animation-fill-mode: forwards;定义闲时填充模式,在结束后以最后帧(forwards)或者在delay前以第一帧填充(backwards)或者全都要(both)

另外:animation是CSS3新属性,需要注意兼容性

注意到学习的网页中有看板娘(live2d)和音乐播放器(APlayer),查询后发现是开源项目,以后有需要可以添加。
但是我注意到ohyhello网站中的音乐播放器是独立在每个页面的,这样给人的体验很不好,为了实现全站统一的效果,找到一个“ 全站pjax ”无刷新加载,需要1.7以上的JQuery。使用AJAX框架,在页面内刷新页面,就可以把播放器放在外面。

周日的html学习

原文:https://www.cnblogs.com/Stratford-International/p/11965798.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!