Skip to content

Instantly share code, notes, and snippets.

@ofmarconi
Created June 19, 2022 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ofmarconi/c65663a119971107bd5764179b78af64 to your computer and use it in GitHub Desktop.
Save ofmarconi/c65663a119971107bd5764179b78af64 to your computer and use it in GitHub Desktop.
inside each .box copy the data-elementor-lightbox property of the element with the .elementor-custom-embed-image-overlay class and paste in the elements with the .title class inside that .box (by askjarvis.io)
const caixas = document.querySelectorAll('.caixa');
caixas.forEach(caixa => {
const dataElementorLightbox = caixa.querySelector('.elementor-custom-embed-image-overlay').getAttribute('data-elementor-lightbox');
const titles = caixa.querySelectorAll('.title');
titles.forEach(title => {
title.setAttribute('data-elementor-lightbox', dataElementorLightbox);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment