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. JZ2440开发板学习 1. 刚接触开发板, 安装驱动

    一. jtag和串口驱动 1. 驱动下载 http://pan.baidu.com/s/1pJkAHJH 2. 驱动安装 禁用win10的驱动数字签名 http://www.100ask.org/bb ...

  2. Android 跑马灯

    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...

  3. 如何在R语言中使用Logistic回归模型

    在日常学习或工作中经常会使用线性回归模型对某一事物进行预测,例如预测房价.身高.GDP.学生成绩等,发现这些被预测的变量都属于连续型变量.然而有些情况下,被预测变量可能是二元变量,即成功或失败.流失或 ...

  4. mac上eclipse用gdb调试(转)

    mac上eclipse用gdb调试 With its new OS release, Apple has discontinued the use of GDB in OS X. Since 2005 ...

  5. Navigator

      Navigator   这是一个简单的例子,用Navigator来跳转页面,页面之间传递参数 (代码是ES6语法写的): import React from 'react'; import { V ...

  6. UE4 使用UGM制作血条

    声明:本文是自己做的项目,可能不是最好的方法,或有错误使用方式.各位不喜勿喷! HP进度 HP背景 将上面的资源拖到UE4中(使用UE4自带的颜色也可实现效果,具体参考官方教程 https://doc ...

  7. 字符串处理总结之二(C#StringBuilder类)

    动态串StringBuilder 与String类相比,System.Text.StringBuilder类可以实现动态字符串.此外,动态的含义是指在修改字符串时,系统不需要创建新的对象,不会重复开辟 ...

  8. java.lang.ExceptionInInitializerError /NoClassDefFoundError: [Lorg/hibernate/engine/FilterDefinition;

    java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nati ...

  9. Servlet开发详解

    一.Servlet简介 Servlet是sun公司提供的一门用于动态web资源的技术 sun公司在其API中提供了一个Servlet接口,用户若想开发一个动态web资源,需要完成两个步骤: 编写一个J ...

  10. localhost访问错误Forbidden You don't have permission to access / on this server.解决办法(亲测)

    在httpd.conf文件下找到这段: <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow D ...