1

I am setting up a LinkedIn tour for the website. http://linkedin.github.io/hopscotch/ It is working fine. But I need to change the text of a done button. Once I put the following line i18n.doneBtn, the static page comes up but dynamic execution stops and tour does not appear. Would you have any suggestions on how to fix it? Thanks!

       "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');
          }
        };
4

1 回答 1

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"
  }
};
于 2013-08-29T20:08:23.897 回答