whats the best way to make scollbar timeline?
so when im scrolline to the right or left side , the timeline follows!
id tried some different way ,but i dont think its good.
1 way was. on my stage in scroll:
var animationWidth = 5000;
var stageWidth = sym.$("Stage").width();
var scrollPos = sym.$("Stage").scrollLeft();
var duration = sym.getDuration();
var percent = scrollPos / (animationWidth-stageWidth);
var time = duration * percent;
// Update timeline
sym.stop(time);
it works but is giving me double scroolbar and the second scrollbar is scrolling out of the "stage"!
2- way i tried was:
// insert code for scroll event here
var myCalc = e.currentTarget.scrollLeft/(e.currentTarget.scrollWidth-e.currentTarg et.clientWidth);
var pos = Math.round( myCalc * sym.getDuration() );
sym.stop(pos);
//console.log('e.currentTarget.scrollLeft = '+e.currentTarget.scrollLeft);
//console.log('e.currentTarget.scrollWidth = '+e.currentTarget.scrollWidth);
//console.log('e.currentTarget.clientWidth = '+e.currentTarget.clientWidth);
console.log('pos = '+pos);
also working but same result as last.
anybody know a stabil way to do thid , or how to fix this?
THANKS!!