jqueryGannt主要用于甘特图的展示,直接上步骤

1、下载

jquery.min.js

js/jquery.fn.gantt.js 的js ,可以自己去github上搜官方的。

其他的要上传对应的style和img,都可以在官网上下载

2、html

<!DOCTYPE html>
<html lang="en">
<head>
<title>jQuery.Gantt - Test Suite 01</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=IE8">
<link href="css/style.css" type="text/css" rel="stylesheet">
<style type="text/css">
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 13px;
padding: 0 0 50px 0;
} .contain {
width: 800px;
margin: 0 auto;
} h1 {
margin: 40px 0 20px 0;
} h2 {
font-size: 1.5em;
padding-bottom: 3px;
border-bottom: 1px solid #DDD;
margin-top: 50px;
margin-bottom: 25px;
} table th:first-child {
width: 150px;
}
</style>
</head>
<body> <div class="gantt"></div> <script src="js/jquery.min.js"></script>
<script src="js/jquery.fn.gantt.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
<script>
function addHour(moment) {
return moment.add(12, "hours");
}
function addHour1(moment) {
return moment.add(6, "hours");
}
function loadgantt() {
var today = moment();
var andTwoHours = addHour1(moment());
var t1 = "/Date(" + today.valueOf() + ")/";
var t2 = "/Date(" + andTwoHours.valueOf() + ")/";
var t3 = "/Date(" + addHour1(andTwoHours).valueOf() + ")/";
var t4 = "/Date(" + addHour1(addHour1(andTwoHours)).valueOf() + ")/";
$(".gantt").gantt({
source : [ {
name : "Testing",
desc : " ",
values : [ {
from : t1,
to : t2,
label : "Test",
customClass : "ganttRed"
}, {
from : t2,
to : t3,
label : "Test1",
customClass : "ganttGreen"
}, {
from : t3,
to : t4,
label : "Test2",
customClass : "ganttOrange"
} ]
}
,
{
name : "Testing1",
desc : " ",
values : [ {
from : t1,
to : t2,
label : "Test",
customClass : "ganttRed"
}, {
from : t2,
to : t3,
label : "Test1",
customClass : "ganttGreen"
}, {
from : t3,
to : t4,
label : "Test2",
customClass : "ganttOrange"
} ]
} ],
scale : "hours",
minScale : "hours",
navigate : "scroll"
}); }
$(function() {
"use strict";
var today = moment();
var andTwoHours = addHour(moment()); var t1 = "/Date(" + today.valueOf() + ")/";
var t2 = "/Date(" + andTwoHours.valueOf() + ")/";
var t3 = "/Date(" + addHour(andTwoHours).valueOf() + ")/";
var t4 = "/Date(" + addHour(addHour(andTwoHours)).valueOf() + ")/";
$(".gantt").gantt({
source : [ {
name : "Testing",
desc : " ",
values : [ {
from : t1,
to : t2,
label : "Test",
customClass : "ganttRed"
}, {
from : t2,
to : t3,
label : "Test1",
customClass : "ganttGreen"
}, {
from : t3,
to : t4,
label : "Test2",
customClass : "ganttOrange"
} ]
}
,
{
name : "Testing1",
desc : " ",
values : [ {
from : t1,
to : t2,
label : "Test",
customClass : "ganttRed"
}, {
from : t2,
to : t3,
label : "Test1",
customClass : "ganttGreen"
}, {
from : t3,
to : t4,
label : "Test2",
customClass : "ganttOrange"
} ]
} ],
scale : "hours",
minScale : "hours",
navigate : "scroll"
}); });
</script>
<input type="button" onclick="loadgantt()" />
</body>
</html>

目录结构

jqueryGannt用法的更多相关文章

  1. EditText 基本用法

    title: EditText 基本用法 tags: EditText,编辑框,输入框 --- EditText介绍: EditText 在开发中也是经常用到的控件,也是一个比较必要的组件,可以说它是 ...

  2. jquery插件的用法之cookie 插件

    一.使用cookie 插件 插件官方网站下载地址:http://plugins.jquery.com/cookie/ cookie 插件的用法比较简单,直接粘贴下面代码示例: //生成一个cookie ...

  3. Java中的Socket的用法

                                   Java中的Socket的用法 Java中的Socket分为普通的Socket和NioSocket. 普通Socket的用法 Java中的 ...

  4. [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法

    一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...

  5. python enumerate 用法

    A new built-in function, enumerate() , will make certain loops a bit clearer. enumerate(thing) , whe ...

  6. [转载]Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法总结

    本文对Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法进行了详细的总结,需要的朋友可以参考下,希望对大家有所帮助. 详细解读Jquery各Ajax函数: ...

  7. 【JavaScript】innerHTML、innerText和outerHTML的用法区别

    用法: <div id="test">   <span style="color:red">test1</span> tes ...

  8. chattr用法

    [root@localhost tmp]# umask 0022 一.chattr用法 1.创建空文件attrtest,然后删除,提示无法删除,因为有隐藏文件 [root@localhost tmp] ...

  9. 萌新笔记——vim命令“=”、“d”、“y”的用法(结合光标移动命令,一些场合会非常方便)

    vim有许多命令,网上搜有一堆贴子.文章列举出各种功能的命令. 对于"="."d"."y",我在无意中发现了它们所具有的相同的一些用法,先举 ...

随机推荐

  1. [转]VB Winsock 控件TCP与UDP连接实例

    [-] 可能的用途 选择通讯协议 协议的设置 确定计算机的名称 TCP 连接初步 接受多个连接请求 UDP 初步 关于 Bind 方法   利用 WinSock 控件可以与远程计算机建立连接,并通过用 ...

  2. 阅读笔记 1 火球 UML大战需求分析

    伴随着七天国庆的结束,紧张的学习生活也开始了,首先声明,阅读笔记随着我不断地阅读进度会慢慢更新,而不是一次性的写完,所以会重复的编辑.对于我选的这本   <火球 UML大战需求分析>,首先 ...

  3. [OC] 图片平铺

    Tip: self.bgImg.image = [self.bgImg.image resizableImageWithCapInsets:UIEdgeInsetsMake(100, 40, 40, ...

  4. NE Upgrade python script. Need to write a Tkinter GUI for it

    # -*- coding: utf-8 -*-#from ftplib import FTP __authour__='CC' import osimport telnetlibimport time ...

  5. solarium atomic update

    https://github.com/solariumphp/solarium/issues/159

  6. MVC 外网 上传 下载 实现方式(一)

    本人在实现第三方文件存储时,为实现Web网络的上传和下载 的实现费了一些时间,然后总结到的一些问题: 如有思路狭隘之处还望指正! 文件上传时: 实现方式 为: 客户端=>第三方=>服务器( ...

  7. springboot中swaggerUI的使用

    demo地址:demo-swagger-springboot springboot中swaggerUI的使用 1.pom文件中添加swagger依赖 2.从github项目中下载swaggerUI 然 ...

  8. 单据UI代码开发

    1.构造UI项目后,打开生成的UI项目代码,在Model文件下,如初始化一些字段的值 2.订单明细行中行号设置.订单基本操作按钮提示UFIDA.U9.Base.BaseBP.Agent.dll(代理) ...

  9. 【开园 and 计划】

    开园 啊啊啊啊啊啊啊啊,郁闷啊,头一回写博客,一刻钟前保存的草稿为何荡然无存??? 那少废话直击要点:今日乃我开园之日,开园为了改变.为了学习.为了积累. 计划 最长为时 3月,截止到 2016年9月 ...

  10. Android中Context详解

    大家好,  今天给大家介绍下我们在应用开发中最熟悉而陌生的朋友-----Context类 ,说它熟悉,是应为我们在开发中时刻的在与它打交道,例如:Service.BroadcastReceiver.A ...