LinkedIn跳房子教程 - 如何更改标签的名称?

时间:2013-08-22 16:18:14

标签: jquery linkedin hopscotch

我正在为该网站建立一个LinkedIn之旅。 http://linkedin.github.io/hopscotch/ 它工作正常。但我需要更改完成按钮的文本。 一旦我将以下行i18n.doneBtn,静态页面出现,但动态执行停止,并且不会出现巡视。 你对如何解决这个问题有什么建议吗?谢谢!

       "fnInitComplete": function (){
        $('#accessModal').modal('show');
        {% if request.user.indTutorial %}

            // Define the tour!
        var tour = {
          id: "hello-hopscotch-1",
          steps: [
            {        
              title: "View the Momentum Rankings",
              content: "Algorithms analyze millions of data points to find the fastest growing companies in any industry.",
              target: "tag-page-title",
              width: 450,
              placement: "bottom",
              showCloseButton: true
            },
            {       
              title: "See momentum scores",
              content: "Click on a company to understand the factors that drive their score.",
              //target: "allResultTable",
              target: document.querySelector(".sorting_1"),
              placement: "bottom",
              showCloseButton: true,
              showPrevButton: true,
              width: 450,
              // the title of the done button - next
              i18n.doneBtn: "Next"
            }
          ],

          onEnd: function() {
            window.location.href = '/company/' + $('.my-row').attr('id');
          }
        };

1 个答案:

答案 0 :(得分:3)

i18n属性应该是一个对象,它应该是你游览的顶级。

看起来应该是这样的:

var tour = {
  id: "hello-hopscotch-1",
  steps: [
    {        
      title: "View the Momentum Rankings",
      content: "Algorithms analyze millions of data points to find the fastest growing companies in any industry.",
      target: "tag-page-title",
      width: 450,
      placement: "bottom",
      showCloseButton: true
    },
    {       
      title: "See momentum scores",
      content: "Click on a company to understand the factors that drive their score.",
      //target: "allResultTable",
      target: document.querySelector(".sorting_1"),
      placement: "bottom",
      showCloseButton: true,
      showPrevButton: true,
      width: 450,
    }
  ],

  onEnd: function() {
    window.location.href = '/company/' + $('.my-row').attr('id');
  },

  i18n: {
    // the title of the done button - next
    doneBtn: "Next"
  }
};