My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Timeline_VerticalScrollbar  
Add a vertical scrollbar to your timeline
Updated Feb 4, 2010 by larryklu...@gmail.com

Add the following CSS to your timeline container.

.your-timeline-container { overflow-x:hidden; overflow-y:scroll;}

This will enabled a vertical scrollbar when you have many events but you will notice that timeline doesn't draw itself completely in the lower part like so:

it's because its height is calculated with the container's starting height. If you take a quick look in the DOM using Firebug, ''you'll notice the '''height''' is within the '''container's style attribute'''''. Bingo! now we just need to find the function that does the calculation or that adds the height to the container.

Find the '''setBandShiftAndWidth''' function in the '''timeline.js''' file and modify the following line :

this._div.style.height = width + "px";

to

this._div.style.height = "100%";

Change the mouseWheel setting in your theme to 'default' See MouseWheelScrollingAndZooming and Timeline_ThemeClass

thats it!

here's what it looks like now:

Comment by desalvomarco@gmail.com, Oct 29, 2008

If i just include "<script src="http://static.simile.mit.edu/timeline/api-2.0/timeline-api.js" type="text/javascript"></script>" in my page to have the timeline, how can i apply your patch to file "timeline.js"? I don't have a local copy of the timeline, neither i need for my application.

Comment by chrisb...@gmail.com, Oct 29, 2008

This implementation is not working for me on version 2.2.0

Comment by dmwhee...@gmail.com, Jan 17, 2009

I can't get this working either (version 2.2.0).

Comment by c3dclas...@gmail.com, Jul 14, 2010

Find the '''setBandShiftAndWidth''' function in the '''band.js''' file and modify the following line which is indicated by the comment below

Timeline.Band.prototype.setBandShiftAndWidth = function(shift, width) {

var inputDiv = this.keyboardInput.parentNode; var middle = shift + Math.floor(width / 2); if (this.timeline.isHorizontal()) {
this.div.style.top = shift + "px";

// add 100% and comment out the other part
this.div.style.height = "100%" /width + "px"/;

inputDiv.style.top = middle + "px"; inputDiv.style.left = "-1em";
} else {
this.div.style.left = shift + "px"; this.div.style.width = width + "px";
inputDiv.style.left = middle + "px"; inputDiv.style.top = "-1em";
}
};

No need to modify 'band.js'. Just reimplement only this function and include it in your file where you define your timeline.

Comment by paulsoda...@gmail.com, Aug 7, 2010

Does this fix still work for 2.3.0.0? It makes no differnce in firefox and breaks IE6!

Comment by fschn...@gmail.com, Jan 6, 2011

Not working :(

Comment by chnic...@gmail.com, Apr 1, 2011

it is not working on 2.3.0 :(

Comment by cwmcdon...@gmail.com, Jun 21, 2011

I had the same problem, I could not get the scroll bar to appear. After looking at the css applied to the div I found the following rule in timeline.css: .timeline-container {

overflow:hidden;; position: relative;
} Replace this with: .timeline-container {
overflow-x:hidden; overflow-y:scroll; position: relative;
}

Make the modification to Timeline.Band.prototype.setBandShiftAndWidth as shown above and your scroll bar should appear. This worked for me in Firefox 4.0 and IE8.

Comment by Mych...@gmail.com, May 14, 2012

Could not get this to work in 2.3.0 :(


Sign in to add a comment
Powered by Google Project Hosting