Hide node by default and show when clicking button

Hi,

I want to hide a node on loading the object.

So when using this it works:

api.addEventListener('viewerready', function () {
// Get the object nodes
 api.getNodeMap(function (err, nodes) {
   if (!err) {
      for (var prop in nodes) {
           if (nodes.hasOwnProperty(prop)) {
               api.hide(nodePSR1_START);
          }
      }
   }
 });
});

I am using jQuery when clicking a button it needs to show the node with

$('li').click(function () {
   api.show(nodePSR1_START);
});

Problem is that the node doesn’t show up then.
Can somebody help me with where to place the default hide node code?

Hi,

Could you share a JSFiddle or CodePen with a full example so I can have a closer look?