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. python 随机生成固定长度的字串

    from random import Random#随机生成4到20位的用户名def random_username(): username = '' chars = 'AaBbCcDdEeFfGgH ...

  2. Oracle数据库的表结构 简单表的建立

  3. King's Quest —— POJ1904(ZOJ2470)Tarjan缩点

    King's Quest Time Limit: 15000MS Memory Limit: 65536K Case Time Limit: 2000MS Description Once upon ...

  4. Netsuite订单审核问题

    销售订单审核自动发送邮件问题: 销售订单界面有“提交审核”按钮,点击提交后会自动发送邮件给审核人,这个审核人可以实现指定发送给销售团队中的“主要”成员吗? Options - 在邮件系统中, 定义那个 ...

  5. mybatis.xml文件中#与$符号的区别以及数学符号的处理

    1.#{}表示一个占位符号,通过#{}可以实现preparedStatement向占位符中设置值,自动进行java类型和jdbc类型转换,#{}可以有效防止sql注入. #{}可以接收简单类型值或po ...

  6. python画图设置坐标轴大小

    在console端输入python语句,会一句输一行,而且不保留你所做的操作,但是每一句之间加一个分号就能很好的解决. import pylab as Plot Plot.xlim(-150, 150 ...

  7. Eclipse通过DDMS打开真机/data/data/目录

    一般真机调试时DDMS里面的File Explorer是不能打开/data 目录的,不过也很容易解决. 1.首先手机要root.这个很简单,网上一大堆资料和软件. 2.仅仅root之后还不行,下载一个 ...

  8. java的print,printf,println以及输入

    java中有三种方式向控制台输入信息,分别是print,printf,println,现在简单介绍一下他们之间的异同. printf主要是继承了C语言的printf的一些特性,可以进行格式化输出 pr ...

  9. jq菜单折叠效果

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  10. 《与小卡特一起学Python》 Code5 for循环

    import time for i in range(10,0,-1): print i time.sleep(1) print "Blast off!" 以上代码循环意思为: 从 ...