ka215 / jquery.timeline

You can easily create the horizontal timeline with two types by using this jQuery plugin.
MIT License
240 stars 43 forks source link

Change scales via jQuery or JS. #73

Open qroft opened 3 years ago

qroft commented 3 years ago

Is your feature request related to a problem? Please describe. I created a button with the intention to make it change my timeline from its init scale of "days" into "months" With the reload method, the timeline changes all apart of the ruler information.

Describe the solution you'd like Change views through buttons.

Describe alternatives you've considered The Zoom feature, but at the moment i did not find out how to zoom back from days :)

Additional context Here is the code that i am currently using based on the manual: ` $('.cvMonths').on('click', function() { let new_options = { scale: 'month' }

        $("#myTimeline").Timeline('reload', new_options, (elm,opts,usrdata) => {
            console.log( usrdata.msg )
        }, {msg:'Changed Scale Type!'})

`

ka215 commented 3 years ago

Hi there,

When changing the scale of the timeline, it is best to optimize the ruler at the same time. I have a demo of the scaling UI, so I'll show you that.

https://ka2.org/jqtl-v2/sample-change-scale.html

Please try to see it, then that may helpful for your inspires.

Thank you,

qroft commented 3 years ago

Thanks, but the DEMO (link you send) shows and endless loading unter Chrome. with the following error in the console: Uncaught (in promise) TypeError: c.toLocaleDateString is not a function

Thanks a lot for your support!

ka215 commented 3 years ago

Hmmm, in my Chrome browser (Windows 10/8, MacOS), there is no error on the demo page. If your browser's cache may be bad, please try again after clearing that cache.

Thank you in advance.