I’m in the process of developing a timeline. The concept is that when an entry in the timeline is clicked, the entire timeline is centered on that entry and the entry expands.
I have a working demo here:
http://jsfiddle.net/A3YhX/9/
I have manually set the css left position (to center the timeline on the clicked item) using the jquery index method (which gives me a numerical value for each item in the timeline when I click it).
What I want to be able to do is have javascript/jquery do the math for me so that if I add items, change their widths, change the size of the container element, etc the jquery function will automatically calculate the css left position.
I know there are plugins out there that do exactly this, but I threw this together from scratch this morning before doing any dissection on existing solutions.
Any and all help/suggestions are greatly appreciated.
Thanks!
mckinselberg
That’ll do it.
http://jsfiddle.net/B6bqM/