【问题标题】:Where do I have to insert the configuration code for jQuery Countdown Plugin by Keith Wood localisation in Wordpress?在 Wordpress 中,我必须在哪里插入 Keith Wood 本地化的 jQuery Countdown 插件的配置代码?
【发布时间】:2014-10-04 10:01:31
【问题描述】:

我在查找需要为 Keith Wood 的倒数计时器添加本地化配置的文件和确切位置时遇到了一些困难。

  1. 我已经将语言包加载到js文件夹中了。
  2. 将此脚本添加到标题中:
<script type="text/javascript" src="jquery.countdown-es.js"></script> 

但我不知道在哪里添加这些:

恢复原始语言设置:

$.countdown.setDefaults($.countdown.regionalOptions['']);

以及每次倒计时的配置:

$('#l10n').countdown($.countdown.regionalOptions['es']); 
$('#l10n').countdown($.extend({other options...}, $.countdown.regionalOptions['es']));

感谢您的支持。

【问题讨论】:

    标签: javascript jquery wordpress jquery-countdown


    【解决方案1】:

    您需要做的就是包含主要的 countdown.js 文件,然后包含 localisation.js 文件。

    如果您尝试翻译成西班牙语,则仅将此代码添加到 localisation.js 文件中:

    (function($) {
        $.countdown.regionalOptions['es'] = {
            labels: ['Años', 'Meses', 'Semanas', 'Días', 'Horas', 'Minutos', 'Segundos'],
            labels1: ['Año', 'Mes', 'Semana', 'Día', 'Hora', 'Minuto', 'Segundo'],
            compactLabels: ['a', 'm', 's', 'g'],
            whichLabels: null,
            digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
            timeSeparator: ':', isRTL: false};
        $.countdown.setDefaults($.countdown.regionalOptions['es']);
    })(jQuery);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-17
      • 2013-02-16
      • 2013-08-31
      • 1970-01-01
      • 1970-01-01
      • 2021-12-04
      相关资源
      最近更新 更多