Web经典案例_时间轴特效
- 格式:docx
- 大小:180.00 KB
- 文档页数:9
年终总结时光轴h5模板以下是一个简单的年终总结时光轴H5模板的示例。
这个模板以时间轴的形式展示了过去一年的重要事件和成就,你可以根据需要进行修改和扩展。
```html<!DOCTYPE html><html><head><title>年终总结时光轴</title><style>/ 样式可以根据需要进行修改 /.timeline {list-style: none;padding: 0;}.timeline-item {position: relative;padding-bottom: 30px;}.timeline-item:before {content: '';position: absolute;top: 0;left: 50%;width: 10px;height: 100%;background-color: eee; }.timeline-content {margin-left: 60px;}h2 {margin-top: 0;}</style></head><body><h1>年终总结</h1><ul class="timeline"><li class="timeline-item"><div class="timeline-content"><h2>XXXX年XX月XX日</h2><p>完成项目A,成功上线</p></div></li><li class="timeline-item"><div class="timeline-content"><h2>XXXX年XX月XX日</h2><p>团队成员获得优秀员工奖</p></div></li><li class="timeline-item"><div class="timeline-content"><h2>XXXX年XX月XX日</h2><p>组织了团队建设活动,增进团队凝聚力</p> </div></li><!-- 添加更多事件 --></ul></body></html>```你可以将以上代码保存为一个`.html`文件,然后在浏览器中打开它。
Photoshop网页设计蒙版图层时间轴动画
Photoshop 网页设计蒙版图层时间轴动画
蒙版图层的时间轴动画效果中,除了普通图层中的位置、不透明度与样式外,还包括图层蒙版位置与图层蒙版启用两个属性。
图层蒙版位置是针对蒙版图形在画布中的位置属性,而图层蒙版启用是在文档中的启用与禁用效果。
1.蒙版位置动画
图层蒙版位置动画主要是利用蒙版图像的移动来创建的,为了不影响图层图像,必须禁用【指示图层蒙版链接到图层】图标。
当一个普通图层中创建图层蒙版后,单击图层蒙版位置的【时1-变化秒表】,创建第1个关键帧,如图1-44所示。
图1-44 创建第1个关键帧
关键帧。
单击【图层】面板中的【指示图层蒙版链接到图层】图标,禁用链接功能,移动蒙版中的图形,如图1-45所示。
图1-45 创建并编辑关键帧中的内容
单击面板底部的【切换洋葱皮】按钮后,单击【播放】按钮。
预览带有洋葱皮效果的动画,如图1-46所示。
JS时间轴效果(类似于qq空间时间轴效果)在上⼀家公司写了⼀个时间轴效果,今天整理了下,感觉有必要写⼀篇博客出来给⼤家分享分享当然代码还有很多不⾜的地⽅,希望⼤家多指点指点下,此效果类似于QQ空间或者⼈⼈⽹空间时间轴效果,当时也是为了需求研究了下qq空间逻辑(当然JS代码压缩了肯定看不到的),只是当时研究了下他们HTML结构和css结构,所以仿照他们那种逻辑⾃⼰也写了⼀个出来。
先来看看是个什么样的吧!如下图所⽰:需求分析:左侧是⼀个时间列表右侧是⼀个时间控制抽,当时的需求是这样的:默认页⾯⼀打开只加载当前年份所有列表加载出来当前年份的控制轴展开出来,默认的焦点在最近的⽉份,如上图在当前的10⽉份或者下图的12⽉份,当滚动条滚动的时候再继续判断如果左侧滚动到⼏⽉份的时候那么右侧控制抽当前的焦点也在⼏⽉份,当滚动到上⼀个年份的时候那么当前的年份控制轴收缩起来上⼀个年份控制轴展开出来,如下图所⽰:当我们点击某⼀年份的时候滚动到当前的年份,当我点击某⼀年中某⼀⽉份的时候滚动到当前年份中对应的⽉份上来。
当然下⾯的代码我是⽤到的是淘宝的KISSY框架当然如果改成Jquery框架也是⼀样的,没有很⼤的差别只是⽤了⼀下"延迟加载"和⼀些选择器⽽已,⾸先我们如果要做成这样的话要知道有2个请求⼀个是左侧列表请求返回的数据⼀个是右侧的年份和⽉份返回的数据下⾯我们可以先来看看开发给我当时返回的数据格式是个什么样的,左侧列表的JSON数据如下图:默认情况下是最近年份当我滚动到2012年时候再继续发个2012年的请求把2012年的相对应的数据渲染出来,同理2011年也⼀样.再来看看年份和⽉份的JSON数据吧如下图:下⾯我⼀步步来分析下我当时的做法:1. ⾸先我需要HTML结构如下图所⽰:<div class="tao-allMonth-w990"><div class="tao-video-left J_Video_Left" id="J_Video_Left"></div><div class="tao-year-right"><div class="mod-timelinenav"><ul id="timelinenavpanel" class="timelinenav-panel isScroll"></ul></div></div></div>其中id="J_Video_Left"和id="timelinenavpanel"在初始化的时候是可以配置的也就是说他们叫什么名字并不重要,依赖于这个HTML结构。
一、时间轴特效 timeline.js 算法思路: 1、点击某个时间点,将该时间点上的li元素添加active类 2、去除上一个li上已添加的active类 语法步骤: step1:定义一个变量,记录当前已经添加active类的li的索引号 step2:查找所有被点击的元素对象 step3:查找所有li元素对象 step4:为每个被点击的对象绑定单击事件 step5:为被点击的时间点li添加active类 step6:根据索引号变量的值,去除上一个li的active类 step7:将索引号变量的值更新为被点击的li的索引号 timeline.js源码:
window.onload = function(){ var //step1 curIndex = 0, //step2 timeLine = document.getElementById("timeline"), clickArea = timeLine.getElementsByTagName("s"), //step3 timePoint = timeLine.getElementsByTagName("li"); //step4 for(var i = 0,len = clickArea.length;i < len;i++){ (function( i ){ clickArea[i].onclick = function(){ //console.log( i );//测试 //step5 timePoint[i].className = "active"; //step6 timePoint[curIndex].className = ""; //step7 curIndex = i; }; })( i ); } }; timeline.css源码: html,body{ background: #c2edf4; }
.container { width: 1000px; margin: 0 auto; background: url(data:image/png); repeat -y 165px 0; }
/* 默认样式 */ .timeline li{ height: 160px; position: relative; }
.timeline li div { position: absolute; }
.timeline .check .spring{ position: absolute; display: block; width: 51px; height: 6px; left: 105px; top: 47px; background: url(data:image/png); }
.timeline .check s { position: absolute; display: block; left: 157px; top: 40px; width: 16px; height: 16px; border: 3px solid #41838E; background: #fff url(../images/sprite.png) 1px -100px; cursor: pointer; } .timeline .check .line { position: absolute; width: 38px; height: 1px; background: #fff; left: 180px; top: 50px; font-size: 1px; }
.timeline .thumb { width: 82px; top: 13px; left: 32px; }
.timeline .thumb img { width: 80px; height: 72px; border: 5px solid #41838E; }
.timeline .thumb span { display: block; height: 30px; line-height: 30px; color: #41838E; text-align: center; font-size: 12px; font-family: Arial black; }
.timeline .content { left: 234px; top: 10px; width: 730px; border-left: 5px solid #41838E; background: #fff }
.timeline .content h3{ margin: 23px 15px; font-size: 30px; font-family: microsoft yahei; } .timeline .content p{ display: none; }
.timeline .content b{ position: absolute; display: block; width: 17px; height: 34px; background: url(../images/sprite.png); left: -21px; top: 25px; }
/* 高亮样式 */ .timeline li.active{ height:250px; }
.timeline li.active div{ position: absolute; }
.timeline .active .check .spring{ left:110px; top: 47px; background: url(data:image/png) }
.timeline .active .check s { left: 152px; top: 36px; width: 20px; height: 10px; border: 5px solid #fff; background: #F26328 url(../images/sprite.png) 2px -200px; cursor: pointer; }
.timeline .active .check .line{ background: #F26328; width: 43px; left: 176px; top: 50px; }
.timeline .active .thumb{ width: 110px; top: 10px; left: -10px; }
.timeline .active . thumb img { width: 110px; top: 10px; left: -10px; }
.timeline .active .thumb span { color: #F26328; }
.timeline .active .content { border-left: 5px solid #F26328; }
.timeline .active .content p { display: block; margin: 23px 15px; line-height: 1.5; font-size:14px; }
.timeline .active .content b { background: url(../images/sprite.png) 0 -43px; left: -20px; } timeline.html源码: timeline 10:00 白宫否认MH370航班降落美军事级第一 人民网旧金山3月18日电 美国白宫方面今日正式否认 了失联客机已在印度洋中部某美军军事基地降落的传闻 7:30 第12天最新消息汇总:调查焦点在于机上机组人员 ①可排除中国乘客涉嫌恐怖和破坏活动的嫌疑②泰国空 军司令证实曾捕获MH370信号
人民网旧金山3月18日电 美国白宫方面今日正式否认 了失联客机已在印度洋中部某美军军事基地降落的传闻
①可排除中国乘客涉嫌恐怖和破坏活动的嫌疑②泰国空 军司令证实曾捕获MH370信号