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. Django day02

    一:Django 中 app 的概念 每个项目里面都会 有很多不同的模块,我们可以把它们写在一个项目里,我们把模块分成一个一个不同的app,这样写可以便于管理,写的一些项目也可能不单单是一个页面,还可 ...

  2. Coursera公开课-Machine_learing:编程作业6

    Support Vector Machines I have some issues to state. First, there were some bugs in original code wh ...

  3. JS排序之快速排序

    JS排序之快速排序 一个数组中的数据,选择索引为(2/数组长度)的那个数据作为基数,数组中的其他数据与它对比,比它数值小的放在做数组,比它数值大的放在右数组,最后组合 左数组+基数+右数组,其中,左数 ...

  4. android黑科技系列——分析某直播App的协议加密原理以及调用加密方法进行协议参数构造

    一.前言 随着直播技术火爆之后,各家都出了直播app,早期直播app的各种请求协议的参数信息都没有做任何加密措施,但是慢慢的有人开始利用这个后门开始弄刷粉关注工具,可以让一个新生的小花旦分分钟变成网红 ...

  5. 运用<body>属性,渲染页面效果

    新建一个HTML5文件,为<body>标签添加样式,代码如下: 01 <!doctype html> 02 <html> 03 <head> 04 &l ...

  6. IN、EXISTS的相关子查询用INNER JOIN 代替--性能优化

    如果保证子查询没有重复 ,IN.EXISTS的相关子查询可以用INNER JOIN 代替.比如: IN.EXISTS的相关子查询用INNER JOIN 代替--sql2000性能优化

  7. Eclipse Rap开发 异步刷新UI处理

    1.Display.getCurrent()获取的是当前线程的display对象,如果当前在非UI线程中那么获取到的display对象为空:      一般Display.getCurrent() 用 ...

  8. 1、Scala安装与基础

    1.scala与java 2.安装 3.scala编译器 4.变量声明 5.数据类型 6.操作符 7.函数调用 8.apply函数 1.scala与java scala基于java虚拟机,所有scal ...

  9. windows常用的cmd命令和常用操作。

    这几日部署Jenkins,牵扯到很多东西,比如用到许多cmd命令和Linux命令.查找比较花时间,因此将查看的文档留下,以避免下次重新查找浪费时间. Windows cmd命令: http://blo ...

  10. POJ_2411_Mondriaan's Dream_状态压缩dp

    Mondriaan's Dream Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 15407   Accepted: 888 ...