Browse Source

added reset function

call reset function before populating timeline with new data (before calling my_timeline_obj.init(my_timeline_config);)

example 

make global:
var timeline_config, storyjs_embedjs;

//in your init function :
if (storyjs_embedjs === undefined) {
    storyjs_embedjs = new VMM.Timeline('my-timeline', '100%', '100%');
    storyjs_embedjs.init(timeline_config);
} else {
    storyjs_embedjs.reset();
    storyjs_embedjs.init(timeline_config);
}
pull/402/head
Daniel 12 years ago
parent
commit
9491fe4c2a
  1. 9
      source/js/VMM.Timeline.js

9
source/js/VMM.Timeline.js

@ -449,7 +449,12 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
slider.setSlide(0);
timenav.setMarker(0, config.ease,config.duration);
};
//call this function before
this.reset = function() {
config.current_slide = 0;
slider.setSlide(0);
timenav.setMarker(0, config.ease,config.duration);
}
/* DATA
================================================== */
function getData(url) {
@ -719,4 +724,4 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
VMM.Timeline.Config = {};
};
};

Loading…
Cancel
Save