1、炫酷的图片是开端啊

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center">

2、前端html 代码

	<div class="container-fluid row">
<timelineaxis ng-show="paramId>0">
<timeaxis-item ng-repeat="item in items">
<a href="#/taxrm/edit/{{item.versionid}}" ng-class="{'active':paramId==item.versionid}">
<timeaxis-point></timeaxis-point>
<timeaxis-panel>{{item.content}}</timeaxis-panel>
</a>
</timeaxis-item>
</timelineaxis>
<div class="timeaxis-hide" ng-show="paramId>0" timeaxis-hide ng-click="hide()"></div>
</div>

3、angular directive

var TaxApp = angular.module('MyApp');
TaxApp.directive("timelineaxis", function () {
return {
restrict: 'AE',
transclude: true,
template: '<div class="timeaxis-warpper" ><ul class="timeaxis" ng-transclude></ul></div>'
};
}); TaxApp.directive("timeaxisItem", function () {
return {
require: '^timeaxis',
restrict: 'AE',
transclude: true,
template: '<li ng-class-even="\'timeaxis-inverted\'" ng-transclude ></li>'
};
}); TaxApp.directive("timeaxisPoint", function () {
return {
require: '^timeaxisItem',
restrict: 'AE',
transclude: true,
template: '<div class="timeaxis-point"><span></span></div>'
};
}); TaxApp.directive("timeaxisPanel", function () {
return {
require: '^timeaxis',
restrict: 'AE',
transclude: true,
template: '<div class="timeaxis-panel" ng-transclude></div>'
};
}); TaxApp.directive("timeaxisHide", function () {
return {
require: '^timeaxisWarpper',
restrict: 'AE',
transclude: true,
template: '<span class="glyphicon glyphicon-menu-up"></span>'
};
});

4、angular controller

angular.module('MyApp').controller('taxrmedit',function($scope,$routeParams){
$scope.paramId = $routeParams.id; if ($scope.paramId > 0) {
$scope.timeaxis = function () {
$scope.items = [{ versionid: 10, content: '2015.07.01~' }, { versionid: 9, content: '2015.05.01~2015.07.01' }, { versionid: 8, content: '2014.12.01~2015.05.01' }, { versionid: 7, content: '2014.01.01~2014.12.01' }, { versionid: 6, content: '2013.10.01~2014.01.01' }];
}; $scope.timeaxis();
}
$scope.hide = function () {
if (angular.element("timelineaxis").attr("style") === undefined || angular.element("timelineaxis").attr("style") != "display: none;") {
angular.element("timelineaxis").hide();
angular.element(".timeaxis-hide>span").removeClass("glyphicon-menu-up");
angular.element(".timeaxis-hide>span").addClass("glyphicon-menu-down");
} else {
angular.element("timelineaxis").show();
angular.element(".timeaxis-hide>span").removeClass("glyphicon-menu-down");
angular.element(".timeaxis-hide>span").addClass("glyphicon-menu-up");
}
}; });

5、样式表

/*时间轴主区设置*/
.timeaxis-warpper
{
overflow-x: auto;
overflow-y: hidden;
display: block;
margin-right: 15px;
padding-left: 15px;
overflow-x: auto;
overflow-y: hidden;
}
/*时间轴箭头设置*/
.timeaxis-warpper:before
{
position: relative;
top: 63px;
left: -15px;
display: inline-block;
border-top: 7px solid transparent;
border-left: 0 solid #00ced1;
border-right: 15px solid #00ced1;
border-bottom: 7px solid transparent;
content: " ";
} .timeaxis
{
padding: 0;
list-style: none;
height: 100px;
position: relative;
width: 100%;
display: inline-flex;
} /*时间轴线设置*/
.timeaxis:before
{
top: 0;
bottom: 0;
position: absolute;
content: " ";
height: 3px;
background-color: #00ced1;
top: 50%;
width: 100%;
}
/*轴线点设置*/
.timeaxis-point
{
width: 8px;
height: 8px;
top: 48px;
margin-left: 65px;
border-radius: 4px;
border: 1px solid #00ced1;
background-color: #ffffff;
background-repeat: no-repeat;
position: absolute;
} .timeaxis-point span
{
color: #bab9c9;
font-size: 10px;
padding: 0;
margin: 0;
position: relative;
left: -5px;
} /*设置区域*/
.timeaxis li
{
float: left;
width: 140px;
height: 30px;
} a .timeaxis-panel
{
background-color: #fff;
float: left;
top: 5px;
border: 1px solid #d4d4d4;
border-radius: 2px;
width: 100%;
height: 100%;
position: relative;
padding: 5px 5px;
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.175);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.175);
} a .timeaxis-panel span
{
color: #333333;
} .timeaxis-panel:before
{
position: absolute;
bottom: -13px;
top: auto;
left: 57px;
display: inline-block;
border-top: 13px solid #ccc;
border-left: 11px solid transparent;
border-right: 11px solid transparent;
border-bottom: 0px solid #ccc;
content: " ";
} .timeaxis-panel:after
{
position: absolute;
bottom: -12px;
top: auto;
left: 58px;
border-top: 12px solid #fff;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 0px solid #fff;
content: " ";
} a.active .timeaxis-panel,
a:focus .timeaxis-panel
{
border: 1px solid #00ced1;
background-color: #00ced1;
} a.active .timeaxis-panel span,
a:focus .timeaxis-panel span
{
color: #ffffff;
} a.active .timeaxis-panel:before,
a:focus .timeaxis-panel:before
{
position: absolute;
bottom: -13px;
top: auto;
left: 57px;
display: inline-block;
border-top: 13px solid #00ced1;
border-left: 11px solid transparent;
border-right: 11px solid transparent;
border-bottom: 0px solid #00ced1;
content: " ";
} a.active .timeaxis-panel:after,
a:focus .timeaxis-panel:after
{
position: absolute;
bottom: -12px;
top: auto;
left: 58px;
border-top: 12px solid #00ced1;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 0px solid #00ced1;
content: " ";
} a.active .timeaxis-point
{
width: 8px;
height: 8px;
top: 48px;
margin-left: 65px;
border-radius: 4px;
border: 2px solid #ffffff;
background-color: #00ced1;
background-repeat: no-repeat;
position: absolute;
} .timeaxis-inverted .timeaxis-panel
{
top: 67px;
} .timeaxis-inverted .timeaxis-panel:before
{
position: absolute;
bottom: auto;
top: -12px;
left: 57px;
display: inline-block;
border-top: 0px solid #ccc;
border-left: 11px solid transparent;
border-right: 11px solid transparent;
border-bottom: 12px solid #ccc;
content: " ";
} .timeaxis-inverted .timeaxis-panel:after
{
position: absolute;
bottom: auto;
top: -11px;
left: 58px;
border-top: 0px solid #fff;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 11px solid #fff;
content: " ";
} .timeaxis-inverted a.active .timeaxis-panel:before,
.timeaxis-inverted a:focus .timeaxis-panel:before
{
position: absolute;
bottom: auto;
top: -12px;
left: 57px;
display: inline-block;
border-top: 0px solid #00ced1;
border-left: 11px solid transparent;
border-right: 11px solid transparent;
border-bottom: 12px solid #00ced1;
content: " ";
} .timeaxis-inverted a.active .timeaxis-panel:after,
.timeaxis-inverted a:focus .timeaxis-panel:after
{
position: absolute;
bottom: auto;
top: -11px;
left: 58px;
display: inline-block;
border-top: 0px solid #00ced1;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 11px solid #00ced1;
content: " ";
} .timeaxis-hide {
width: 100%;
padding-left: 50%;
height: 15px;
background-color: #00ced1;
color: #ffffff;
position: relative;
display: inline-block;
}

完活。!!

angularjs时间轴的更多相关文章

  1. AngularJS时间轴指令

    是基于ion.rangeSlider.js,主要代码如下: <link rel="stylesheet" type="text/css" href=&qu ...

  2. iOS之TimeLine(时间轴)的实现

    这是一个关于OC时间轴的简单实现,我认为重要的是思路. 感谢作者:Cyandev 的文章<iOS 实现时间线列表效果>给的思路.这里先附上Objective-C的代码实现,有时间再去试试S ...

  3. 08. Web大前端时代之:HTML5+CSS3入门系列 ~ QQ空间时间轴

    Web大前端时代之:HTML5+CSS3入门系列:http://www.cnblogs.com/dunitian/p/5121725.html 大前端系列,主要就是使用CSS3.0来实现,注释我已经打 ...

  4. [原创]首次制作JQueryUI插件-Timeline时间轴

    特点: 1. 支持多左右滚动,左右拖动. 2. 时间轴可上下两种显示方式. 3. 支持两种模式的平滑滚动/拖动. 4. 行压缩(后续版本此处可设置是否开启,上传的代码不带这个功能). 5. 支持hov ...

  5. SmohanTimeLine.js 酷炫的时间轴效果

    展示地址 点此下载 原文出处 一.参数说明 item : '.item', //项目元素 top : 30, //与下一行的间距 pointWidth : 22, //时间点宽度 cornerWidt ...

  6. jquery时间轴幻灯展示源代码

    查看效果:http://hovertree.com/texiao/jquery/75/ 源代码下载:http://hovertree.com/h/bjaf/8jlpc2wu.htm 效果图如下: 代码 ...

  7. Timeline Portfolio - 时间轴作品集效果

    这里分享一个超炫的时间轴展示作品集效果.设计师和前端开发人员可以借助这个效果来制作新颖的作品集和个人简历.时间轴专门用来呈现出年代的一系列事件.您可以把这种效果嵌入各种媒体,包括微博,视频和地图,并把 ...

  8. JQuery+HTML5+CSS3制作时间轴插件,支持响应式布局

    一.效果图预览 (图一) (图二) 附注说明: 图一是浏览器宽度像素大于560px下的展示效果,图二是在浏览器宽度像素小于560px下的展现效果.使用的是CSS3的Media Query(媒体查询)实 ...

  9. 纯手工打造漂亮的垂直时间轴,使用最简单的HTML+CSS+JQUERY完成100个版本更新记录的华丽转身!

    前言 FineUI控件库发展至今已经有 5 个年头,目前论坛注册的QQ会员 5000 多人,捐赠用户 500 多人(捐赠用户转化率达到10%以上,在国内开源领域相信这是一个梦幻数字!也足以证明Fine ...

随机推荐

  1. codevs2594解药还是毒药(状压dp)

    2594 解药还是毒药  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond     题目描述 Description Smart研制出对付各种症状的解药,可是 ...

  2. Django day06 模版层(二) 过滤器 标签

    一: 模板语言之过滤器: " | " 前后的区分: 前面的是函数的第一个参数, 后面的是python的一个函数, 冒号后面的是第二个参数例:  <p>过滤器之默认值:{ ...

  3. jFinal基于maven简单的demo

    JFinal 是基于Java 语言的极速 web 开发框架,其核心设计目标是开发迅速.代码量少.学习简单.功能强大.轻量级.易扩展.Restful.在拥有Java语言所有优势的同时再拥有ruby.py ...

  4. Redis学习笔记(二):Redis集群

    集群通过分片(sharding)来进行数据共享,并提供复制和故障转移功能.   1.节点 一个节点就是一个运行在集群模式下的Redis服务器.启动Redis服务器时,通过判断cluster-enabl ...

  5. 基于CGAL的Delaunay三角网应用

    目录 1. 背景 1.1 CGAL 1.2 cgal-bindings(Python包) 1.3 vtk-python 1.4 PyQt5 2. 功能设计 2.1 基本目标 2.2 待实现目标 3. ...

  6. Elasticsearch之批量操作bulk

    1.bulk相当于数据库里的bash操作. 2.引入批量操作bulk,提高工作效率,你想啊,一批一批添加与一条一条添加,谁快? 3.bulk API可以帮助我们同时执行多个请求 4.bulk的格式: ...

  7. java Queue中 remove/poll, add/offer, element/peek区别

    offer,add区别: 一些队列有大小限制,因此如果想在一个满的队列中加入一个新项,多出的项就会被拒绝. 这时新的 offer 方法就可以起作用了.它不是对调用 add() 方法抛出一个 unche ...

  8. P2241 统计方形(数据加强版)

    题目背景 1997年普及组第一题 题目描述 有一个n*m方格的棋盘,求其方格包含多少正方形.长方形 输入输出格式 输入格式: n,m因为原来数据太弱,现规定m小于等于5000,n小于等于5000(原来 ...

  9. Django学习案例一(blog):五. 开发主页(博客列表展示)

    主页是一个“博客列表”页.博客要按发布时间的倒序来排列,每个博客都要包含标题.作者.分类.发布时间的显示(年-月-日 时:分)及节选的正文内容(前 100 个字).点击单独的博客可以进入其详情页. 1 ...

  10. Android MediaRecorder自定义分辨率

    Android MediaRecorder自定义分辨率 工作这么久了,确实积累了不少东西,但都是以文档的形式存在U盘里的,为什么不写博客呢?因为懒啊!!!总感觉博客太难写了(大概是上学时候写作文恐惧症 ...