Pure Css+js Horizontal Time axis

Source: Internet
Author: User

Custom, and automatically load time nodes

Center current time node, highlighting

Time dynamic non-marking add

Initial state

Time left to a certain 2016.1 months after

Html:

<!--horizontal time axis--
<div id= "Timeline" style= "WIDTH:902PX; height:60px; " >
<ul id= "Dates" style= "position:absolute; right:0; Top: -10px; " ></ul>
<ul id= "Issues" style= "display:none;" >
</ul>
<div id= "Grad_left" style= "Display:none;" >
</div>
<div id= "Grad_right" style= "Display:none;" ></div>
<a href= "#" id= "Next" style= "Display:none;" >+</a>
<a href= "#" id= "prev" style= "Display:none;" >-</a>
</div>
<!--End Horizontal time axis--

corresponding JS set Processing:

var left = document.getElementById (datesdiv). Offsetleft + parseint ($ ("#" + datesdiv). Parent (). CSS (' Background-position-y ') + $ ("#" + datesdiv). Children (). width ();
var newyear = parseint ($ ("#dates li:first-child a"). attr (' year ')-1;
if (Left > 0) {
var datesli = "";
for (var i = 1; i <=; i++) {
Datesli + = "<li><a href=\" javascript:void (); \ "Onclick=\" Choosemonth (' "+ NewYear +" ', ' "+ i +" ') \ "year=" + NE Wyear + "Month=" + i + ">" + NewYear + "." + i + "</a></li>";
}
$ ("#dates"). Width ($ ("#dates"). Width () + * $ ("#" + datesdiv). Children (). width ());
$ ("#dates li:first-child"). Before ($ (DATESLI));
$ (). TIMELINR ({arrowkeys: ' true '});//In the source code, the Click event is bound to a on, not re-initialized here
}

Information Download: Link: http://pan.baidu.com/s/1o8lezNG Password: 7q6n

Pure Css+js Horizontal Time axis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.