timeglider / jquery_widget

Timeglider's JS Widget component. See README for details.
193 stars 41 forks source link

Limit timeline scroll range #39

Closed framejk closed 12 years ago

framejk commented 12 years ago

Love the plugin and thanks for the great work.

We would like to use timeglider to present a series of timelines by decade, and do not want viewers to be able to scroll past certain boundaries. The decades will all be part of a horizontal accordion, and the users can view timelines from the 70's, 80's, 90's, etc.

I could not find an option to limit the scroll ranges, is this something that is planned, or something we will need to build in ourselves?

timeglider commented 12 years ago

This is actually something we're working on. There's a demo of a working version here: http://timeglider.com/jquery/methods.html

In the options (and this is not documented yet), you would add: constrain_to_data:true Eventually, this will be the default value for the option.

It's still a little clunky, as it bounces back a bit. We can't use the typical "constrain" of jquery ui draggable, as there's no parent element to constrain to. Will be improving this in the coming weeks.

framejk commented 12 years ago

Thanks for the quick response. I looked at the demo and was still able to drag outside of the timeline. And when I zoomed out to 100, it showed -10billion BC to 10 billion AD on the ticks bar.

We want to limit the ticks to only show a certain range (i.e. 1/1/2000 - 12/31/2009) and we will be using a fixed zoom level.

timeglider commented 12 years ago

Were you by chance using the little "scrollbar" at the bottom? That's a separate, experimental feature that's not connected to the constraint system right now.

I'm testing on all Mac and Win FF and IE8+ browsers, and when just dragging the timeline itself (not the green "scrubber/scrollbar") it stops at left and right sides. What's your browser?

There's no restriction on the zooming for this demo, but you can restrict zooming easily with "min_zoom" and "max_zoom" in your own project. (setting them at the same value eliminates the zoom scroller).

On Wed, Mar 7, 2012 at 1:05 PM, framejk < reply@reply.github.com

wrote:

Thanks for the quick response. I looked at the demo and was still able to drag outside of the timeline. And when I zoomed out to 100, it showed -10billion BC to 10 billion AD on the ticks bar.

We want to limit the ticks to only show a certain range (i.e. 1/1/2000 - 12/31/2009) and we will be using a fixed zoom level.


Reply to this email directly or view it on GitHub: https://github.com/timeglider/jquery_widget/issues/39#issuecomment-4376067