Skip to content
Discussion options

You must be logged in to vote

@kirkcola thanks for reaching out.

As soon as you remove an element from the system, by updating .htmlElementsData, it will disappear at once so whatever style changes you make after that time will not be shown.

So what you can do in this case is "delay" the element removal until the fade out effect has had time to run its course.

Here is a somewhat loose example of how this could work for fading-out elements on click:

myGlobe.htmlElement(elData => {
  const el = document.createElement('div');
  ...
  el.style.transition = 'opacity 250ms';
  el.onclick = () => {
    el.style.opacity = 0;
    setTimeout(
      () => myGlobe.htmlElementsData(myGlobe.htmlElementsData().filter(d => d !== elData)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kirkcola
Comment options

Answer selected by kirkcola
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants