jqueryGannt用法
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用法的更多相关文章
- EditText 基本用法
title: EditText 基本用法 tags: EditText,编辑框,输入框 --- EditText介绍: EditText 在开发中也是经常用到的控件,也是一个比较必要的组件,可以说它是 ...
- jquery插件的用法之cookie 插件
一.使用cookie 插件 插件官方网站下载地址:http://plugins.jquery.com/cookie/ cookie 插件的用法比较简单,直接粘贴下面代码示例: //生成一个cookie ...
- Java中的Socket的用法
Java中的Socket的用法 Java中的Socket分为普通的Socket和NioSocket. 普通Socket的用法 Java中的 ...
- [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法
一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...
- python enumerate 用法
A new built-in function, enumerate() , will make certain loops a bit clearer. enumerate(thing) , whe ...
- [转载]Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法总结
本文对Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法进行了详细的总结,需要的朋友可以参考下,希望对大家有所帮助. 详细解读Jquery各Ajax函数: ...
- 【JavaScript】innerHTML、innerText和outerHTML的用法区别
用法: <div id="test"> <span style="color:red">test1</span> tes ...
- chattr用法
[root@localhost tmp]# umask 0022 一.chattr用法 1.创建空文件attrtest,然后删除,提示无法删除,因为有隐藏文件 [root@localhost tmp] ...
- 萌新笔记——vim命令“=”、“d”、“y”的用法(结合光标移动命令,一些场合会非常方便)
vim有许多命令,网上搜有一堆贴子.文章列举出各种功能的命令. 对于"="."d"."y",我在无意中发现了它们所具有的相同的一些用法,先举 ...
随机推荐
- Flags-Ural1225简单递推
Time limit: 1.0 second Memory limit: 64 MB On the Day of the Flag of Russia a shop-owner decided to ...
- clover 在win10下工作不正常
1. 右键兼容性, 选win8 2. 文件夹选项:在同一个窗口中打开每个文件夹
- spark使用02
1.rdd的初始化 1.1 读取文件来初始化rdd(通过sparkContext的textFile方法) 1.1.1 读取本地文件 SparkConf conf = new SparkConf().s ...
- 1.Dotnet Core安装
DtnetCore1.0.1的安装包我以上传至百度网盘,里面有安装教程. http://pan.baidu.com/s/1c2iLNNE 如果安装不上,请留言,我会在第一时间回复你. 不需要挂VPN.
- XML创建与解析常用方法介绍
XML解析方式介绍 1.DOM4J(Document Object Model for Java) 虽然DOM4J代表了完全独立的开发结果,但最初,它是JDOM的一种智能分支.它合并了许多超 ...
- Digital Roots
Background The digital root of a positive integer is found by summing the digits of the integer. If ...
- Delphi中使用比较少的一些语法
本文是为了加强记忆而写,这里写的大多数内容都是在编程的日常工作中使用频率不高的东西,但是又十分重要. ---Murphy 1,构造和析构函数: a,构造函数: 一般基于TComponent组件的派生类 ...
- myeclipse10 优化设置
http://it.oyksoft.com/post/5898/ 一.Myeclipse10修改字体MyEclipse10是基于Eclipse3.7内核,但在Eclipse的Preferences-〉 ...
- spring监听器
1,web.xml中配,因为tomcat启动web项目时先加载web.xml. 2,spring需要启动IOC容器才能为其他框架提供服务,spring是通过监听器来启动容器,初始化 这边启动它,也得告 ...
- 解决qt程序运行时的cannot create Qt for Embedded Linux data directory: /tmp/qtembedded-0出错情形
1.mkdir /tmp 2.挂载 mount -t tmpfs -o size=32m none /tmp