Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
How disable lightbox for some images Javascript?

I put a lightbox in a JavaScript file that affects all images, and a little image in the middle of each image.

You click the smaller image to see a bigger version of the image.

My question is, is there a way to turn off LightBox for some images? link

lightbox = document.createElement('div')
lightbox.id = 'lightbox' 
document.body.appendChild(lightbox) 

const images document.querySelectorAll('img') images.forEach(image => {
  image.addEventListener('click', e => {
  lightbox.classList.add('active')
  const img = document.createElement('img')
  img.src = image.src
  while(lightbox.firstChild) {
      lightbox.removeChild(lightbox.firstChild)
  }
  lightbox.appendChild(img)

  })})
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!