LinkedInAttic / hopscotch

A framework to make it easy for developers to add product tours to their pages.
Apache License 2.0
4.2k stars 666 forks source link

Addclass not working #383

Closed tristan1970 closed 4 years ago

tristan1970 commented 4 years ago

Apologies for the newbie question, but i am trying to add a class to the #cs-content element on my page, upon start of the tour.

Tried this with onStart, which is I believe correct syntax, so is this a bug?

// Define the tour!
    var tour = {
      id: "hello-hopscotch",
      steps: [
        {
          title: "Week 1",
          content: "This week is about this new thing",
          target: "title1",
          placement: "bottom"
        },
         {
          title: "Look at this",
          content: "You can select any of the three modules",
          target: "title-step1",
          placement: "top"
        },
        {
          title: "Open the menu here",
          content: "You can select any of the three modules",
          target: "column1",
          placement: "right"
        } 
      ],
      onStart: function() {
      $('#cs-content').addClass('nosnap');
      }
    };
tristan1970 commented 4 years ago

fixed it. Newbie JS mistake