Exit-button to remove the pop-up button for Elfsight calendar

Please add the possibility to remove the pop-up button for the Elfsight calendar and the possibility to exclude landing pages on website, the same as available for regular pop-ups.

Kind regards.

Hi @Natasja_Young_Mi, welcome to the Community! :waving_hand:

Thanks so much for sharing your feedback!

Having the option to choose which pages the widget appears on would definitely be a great improvement! We already have this idea on our Wishlist, so feel free to upvote it here: Add option to exclude from specific pages

As for the button, could you clarify how you’d like it to work? Would you prefer to hide it completely by default, or would you like to have a Close button so visitors can dismiss it themselves?

If you mean the second option, am I right that you’d like the Close button to appear in the top-right corner?

To choose by them selves. Yes. Richt button corner

Got it, thanks!

We’ll try to consider this as an option in the settings, especially if more users support this idea.

In the meantime, our devs came up with a custom solution for you! Please add the code below to the Custom CSS field on the Settings tab of your widget’s settings:

.es-floating-button-container.es-floating-button-hidden {
  display: none;
}

.es-floating-button-close {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  opacity: 0.8;
}

.es-floating-button-close:hover {
  opacity: 1;
}

.es-floating-button-close svg {
  width: 10px;
  height: 10px;
  fill: #ffffff;
}

And this script should be placed in the Custom JS field on the Settings tab:

const closeIcon = `<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.06645 11.8966L3.8917 17.0714C3.11017 17.8529 1.84307 17.8529 1.06154 17.0714C0.280008 16.2899 0.280009 15.0228 1.06154 14.2412L6.23629 9.06648L1.06154 3.89173C0.280008 3.1102 0.280008 1.8431 1.06154 1.06157C1.84307 0.280039 3.11017 0.28004 3.8917 1.06157L9.06645 6.23632L14.2412 1.06157C15.0227 0.280038 16.2898 0.280039 17.0714 1.06157C17.8529 1.8431 17.8529 3.1102 17.0714 3.89173L11.8966 9.06648L17.0714 14.2412C17.8529 15.0228 17.8529 16.2899 17.0714 17.0714C16.2898 17.8529 15.0227 17.8529 14.2412 17.0714L9.06645 11.8966Z"/></svg>`;

util.waitForElement('.es-floating-button-container').then((container) => {
  const closeButton = document.createElement('button');
  closeButton.type = 'button';
  closeButton.className = 'es-floating-button-close';
  closeButton.setAttribute('aria-label', 'Close');
  closeButton.innerHTML = closeIcon;
  closeButton.addEventListener('click', (event) => {
    event.stopPropagation();
    container.classList.add('es-floating-button-hidden');
  });
  container.append(closeButton);
});

Note: Custom JS operates only upon widget installation, not in preview mode.


This way, clicking the Close button will hide the floating popup button. If you reload the page, the button will appear again.

Check it out and let me know if you like the result :blush:

Thank you for the quick response and perfect solution. Thank you so much!

Awesome, you’re very welcome :wink: