简体   繁体   中英

Timeglider object always staying empty and undefined

So my example is really basic. Actually not even the basic example from the Timeglider examples is working:

var tg1 = {};
    $(function () { 
        tg1 = $("#placement").timeline({
                "icon_folder":"timeglider/icons/",
                "data_source":"json/idaho.json"
        });
        tg_actor = tg1.data("timeline");
        tg_actor.zoom(1);
    }); 

It says that tg1.data("timeline") is undefined. Even though there is data in there.

So my issue is that I cannot create an instance of the Timeglider plugin. So I'm not able to use it's functions. Could someone tell me why the data object is always undefined?

Here it is working...

So I found this running example: http://www.avo.alaska.edu/includes/js/timeglider/kitchen_sink.html and here it is working properly. I studied the code and it's nearly the same I have. So what could I have done different?

Working with older jQuery version

http://code.jquery.com/jquery-1.11.2.min.js is working without an error. How can I use the latest jQuery? Even with the migrate plugin I get the same error.

使用jQuery 1.11.2( http://code.jquery.com/jquery-1.11.2.min.js ),因此该插件似乎与最新版本不兼容。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM