gantti
gantti copied to clipboard
Default view on today?
How do I specify that the default view shows the current day (the white line?)
Thanks
Looks gorgeous BTW
it does this by default, i think.
I think we can close this issue?
I think he means the scroll bar automatically point to the current date.
@antonioj1015 , here's a solution
I scrolled it in JS by doing this:
index.php:
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<div id="gantti">
<?php echo $gantti ?>
</div>
js:
$("body > div[id]").each(function() {
var id = "#" + $(this).attr('id');
try {
$(id + " .today")[0].scrollIntoView();
var scrollLeft = $(id + " .gantt-data").scrollLeft();
var position = $(id + " .today").position().left - $(id + " .gantt-day").width() * 1;
$(id + " .gantt-data").scrollLeft(scrollLeft + position);
} catch (e) {
null;
}
});
$(document).scrollTop(0);