سؤال

I am working on x3dom, now I have a two groups in the xhtml file, I want to show only one group at a time by clicking the button. Here is my code, but it doesn't work, only when I replace hide() with remove() it worked, however by removing the group I don't know how to bring them up a again. Anyone good solutions?

    $("#btn").click(function () {
          Group[DEF="ball"].show();
              Group[DEF="num"].hide();
    });
هل كانت مفيدة؟

المحلول

IMHO show() and hide() work with CSS properties. remove() removes the element from the DOM so it will not be displayed no more and can not be retrieved that easily (besides using XHR or stuff like that). What you probably want is to set the render attribute like node.attr('render', true); or node.attr('render', false);, respectively

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top