javascript - Position of a vertical div on an horizontal div with database dates in Rails (timeline) -
i create kind of timeline (horizontal line: div) data coming database creation date. place kind of marker (vertical line) automatically on timeline date.
the issue timeline div fix size (responsive size in %) when there new data on timeline, others has resize. , example, if have 3 dates: 2009 -2010 -2045 of course there more space between 2010 , 2045 2009 , 2010 ...
do have advises / algorithm please?
thanks advance
if want place them scale, can like:
totaltime = maxdate - mindate each date ypercentage = (maxdate - date) / totaltime
this put first date @ start, last date @ end, , others in between, proportionally.
Comments
Post a Comment