日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

jqueryGannt用法

發(fā)布時間:2024/4/17 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 jqueryGannt用法 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

jqueryGannt主要用于甘特圖的展示,直接上步驟

1、下載

jquery.min.js

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

其他的要上傳對應(yīng)的style和img,都可以在官網(wǎng)上下載

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>

?目錄結(jié)構(gòu)

?

轉(zhuǎn)載于:https://www.cnblogs.com/wangcc/p/6234739.html

與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖

總結(jié)

以上是生活随笔為你收集整理的jqueryGannt用法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。