3 Replies Latest reply on Oct 5, 2012 8:17 AM by heathrowe

    How do I remove an element from the DOM?

    $(sean)

      I'm worried there are too many objects being handled at once and this is affecting performance. Is there anything like a Flash's blacnk key frame to remove an item from the timeline?

        • 1. Re: How do I remove an element from the DOM?
          heathrowe Most Valuable Participant

          You can use the Property Panel 'Display' option(s): Always On, On, Off.

           

          Select the element, position the playhead where you need the display option to occur and chosse your option: Off, then On at another position on the timeline.

           

          I think the trick is to organize your elements as much as possbile, through EA workflow: Groups, Nesting or Symbols. These three management options can shave off a lot of action calls if structured efficiently.

           

          You can also resort to scripted routines and some logic to append(), empty() or remove() (other Dom removal methods here) specific elements at a moment along the timeline.

           

          Hope this helps

           

          Darrell

          • 2. Re: How do I remove an element from the DOM?
            $(sean) Level 1

            Setting display to none (off) is what I'm doind now, but how efficient is that?

             

            I can see that is disables all other tweening options so that would suggest I'm saving on processing power, in that I can't effect an item while it's not displayed (not that I would want to) but I'd be surprised if it were as good as comletely removing it. At the very least, I'd expect some RAM to be returned if it could be gotten rid of. But on top of that I wouldn't be depending on the browser to be efficient about how it handles elements that display:none.

             

            I'll have a look at the code route, but it looks like that would only help me remove an item I'm done with, not one I'm not ready to use.

             

            Is there a way of removing an item with code then returning it when I want it to be displayed?

            • 3. Re: How do I remove an element from the DOM?
              heathrowe Most Valuable Participant

              Please check the Dom removal methods I mention above.

               

              Darrell