Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议改进 #1

Open
jayli opened this issue Sep 25, 2013 · 1 comment
Open

建议改进 #1

jayli opened this issue Sep 25, 2013 · 1 comment

Comments

@jayli
Copy link

jayli commented Sep 25, 2013

Timeline 的初始化参数

var tl = new TimeLines({
    container:'',//容器
    data:{},//数据源
    today:'',// 当前日期,默认为当天
    today_cls:'',//当前日期高亮样式ClassName,
    speed:1//标签滚动速度,间隔1秒
});

Data格式

[
    {
        date:'',//日期
        tip:''.//字符串或者数组
        hl_cls:''//高亮样式
    }
]

默认css中提供几个典型的高亮样式,比如红黄蓝绿之类

实例方法:

var tl = new Timelines();

tl.prev(); // tip 行走到上一个
tl.next(); // tip 行走到下一个
tl.go(index|日期); // tip 行走到第几个,tip 行走到某个日期
tl.getCurrentDate();// 得到当前tip行走到的日期

实例事件

tl.on('beforeSlide',function(e){
    e.timeLineDate; // 切换之前的日期
    e.target;// tip对象
});

tl.on('afterSlide',function(e){
    e.timeLineDate; // 切换之后的日期
    e.target;// tip对象
});
@jixiangac
Copy link
Owner

恩,下一步朝这个方向改进。
谢谢@jayli 拔赤 大大的建议

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants