Skip to content

Commit dcd0345

Browse files
committed
Uses CSS positions instead of margins to position item bars.
Fixes #13.
1 parent 2c11a09 commit dcd0345

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
background-image: url(../img/grid.png);
106106
background-repeat: repeat;
107107
background-position: 24px 24px;
108+
position: relative;
108109
}
109110
.fn-gantt .day, .fn-gantt .date {
110111
overflow: visible;

js/jquery.fn.gantt.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@
10331033
var topEl = $(element).find("#rowheader" + i);
10341034

10351035
var top = tools.getCellSize() * 5 + 2 + parseInt(topEl.attr("offset"), 10);
1036-
_bar.css({ 'margin-top': top, 'margin-left': Math.floor(cFrom) });
1036+
_bar.css({ 'top': top, 'left': Math.floor(cFrom) });
10371037

10381038
datapanel.append(_bar);
10391039
break;
@@ -1076,7 +1076,7 @@
10761076
var topEl = $(element).find("#rowheader" + i);
10771077

10781078
var top = tools.getCellSize() * 3 + 2 + parseInt(topEl.attr("offset"), 10);
1079-
_bar.css({ 'margin-top': top, 'margin-left': Math.floor(cFrom) });
1079+
_bar.css({ 'top': top, 'left': Math.floor(cFrom) });
10801080

10811081
datapanel.append(_bar);
10821082
break;
@@ -1116,7 +1116,7 @@
11161116
var topEl = $(element).find("#rowheader" + i);
11171117

11181118
var top = tools.getCellSize() * 2 + 2 + parseInt(topEl.attr("offset"), 10);
1119-
_bar.css({ 'margin-top': top, 'margin-left': Math.floor(cFrom) });
1119+
_bar.css({ 'top': top, 'left': Math.floor(cFrom) });
11201120

11211121
datapanel.append(_bar);
11221122
break;
@@ -1142,7 +1142,7 @@
11421142
var topEl = $(element).find("#rowheader" + i);
11431143

11441144
var top = tools.getCellSize() * 4 + 2 + parseInt(topEl.attr("offset"), 10);
1145-
_bar.css({ 'margin-top': top, 'margin-left': Math.floor(cFrom) });
1145+
_bar.css({ 'top': top, 'left': Math.floor(cFrom) });
11461146

11471147
datapanel.append(_bar);
11481148

0 commit comments

Comments
 (0)