/*
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
* Copyright (c) 2013-2018 北京泉江科技有限公司
* 创建人:Learun智慧校园-前端开发组
* 日 期:2017.03.22
* 描 述:时间轴方法(降序)
*/
$.fn.lrtimeline = function (nodelist) {
// title 标题
// people 审核人
// content 内容
// time 时间
var $self = $(this);
if ($self.length == 0) {
return $self;
}
$self.addClass('lr-timeline');
var $wrap = $('
');
var $ul = $('');
// 开始节点
var $begin = $('')
$ul.append($begin);
$.each(nodelist, function (_index, _item) {
// 中间节点
var $li = $('');
if (_index == 0) {
$li.find('div').addClass('lr-timeline-current');
}
var $itemwrap = $li.find('.lr-timeline-wrap');
var $itemcontent = $('
');
$itemcontent.append('' + _item.title + '
');
$itemcontent.append(
'' + _item.people + '' + _item.content + '
');
$itemwrap.append('' + _item.time + '');
$itemwrap.append($itemcontent);
$itemwrap.find(".lr-event").on("click", function () { _item.callback(_item); });
$ul.append($li);
});
// 结束节点
$ul.append('开始
');
$wrap.html($ul);
$self.html($wrap);
};