admin管理员组文章数量:1278916
i'm trying to change the language of the labels on a FlipClock.js clock programatically, when the user selects a language from a dropdown.
i see how to set the language when instantiating the clock (.html) and i see the docs here but I'm not sure how to dynamically change the language.
something like:
var clock = $('#flipclock').FlipClock(6000, {
countdown: true,
clockFace: 'DailyCounter'
});
clock.loadLanguage("es"); // change language? doesn't work
but that doesn't work. i also tried
clock.language = "es";
and that didn't work either. any ideas?
i'm trying to change the language of the labels on a FlipClock.js clock programatically, when the user selects a language from a dropdown.
i see how to set the language when instantiating the clock (https://github./objectivehtml/FlipClock/blob/master/examples/localization.html) and i see the docs here http://flipclockjs./api but I'm not sure how to dynamically change the language.
something like:
var clock = $('#flipclock').FlipClock(6000, {
countdown: true,
clockFace: 'DailyCounter'
});
clock.loadLanguage("es"); // change language? doesn't work
but that doesn't work. i also tried
clock.language = "es";
and that didn't work either. any ideas?
Share Improve this question asked Aug 12, 2014 at 20:53 split19split19 6378 silver badges19 bronze badges 1- I can't seem to see anything on their API docs, so my suggestion may be a little convoluted. When the user chooses a new language, save the current time of the clock, destroy the current clock, and then reinstantiate it with the new language and old time – Brennan Commented Aug 12, 2014 at 20:57
2 Answers
Reset to default 9var clock = $('#flipclock').FlipClock(6000, {
countdown: true,
clockFace: 'DailyCounter',
language:'es-es',
});
clock.setOptions('language', 'spanish');
本文标签: javascriptdynamically change language on flipclockjsStack Overflow
版权声明:本文标题:javascript - dynamically change language on flipclock.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741286385a2370292.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论