You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 17, 2019. It is now read-only.
Thanks for the plugin.
I had a problem. Called twice afterChange. I think it will be better. I added 'easeOutBack' to the animation and made a check before changing left.
// --------------- Update the position of the timeline ---------------
function _updateTimelinePos(callEvent) {
var linePos = $el.find('.' + options.className + '-vertical-line').position().left;
var activeDotPos = $el.find('.' + options.className + '-timeblock.active').position().left;
var dotRadius = $el.find('.' + options.className + '-timeblock.active .' + options.className + '-dot').width() / 2;
var diff = activeDotPos - linePos;
var left;
if (diff > 0) {
left = '-' + (Math.abs(diff) + dotRadius + 1) +'';
} else {
left = '+' + (Math.abs(diff) - dotRadius - 1) +'';
}
var tl=$el.find('.' + options.className + '-timeline');
if ($(tl).position().left != left) {
$el.find('.' + options.className + '-timeline').stop().animate({
left: left
}, options.animationSpeed, 'easeOutBack', function() {
if (typeof callEvent != 'undefined') {
if (callEvent === 'click') {
var currYear = $el.find('.' + options.className + '-timeblock.active').first().attr('data-year');
hook('afterChange', [currYear]);
}
else if (callEvent === 'resize') hook('afterResize');
}
});
}
}
Activity