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

233
Views
Cómo acceder: :antes del elemento

He usado viwerJs para mostrar las imágenes. cuando iba a acceder al Css en mi proyecto, quería usar javascript para eso. Así que mi problema fue cuando iba a hacer el siguiente proceso al que no podía acceder ::before del elemento para establecer el margen

aquí está el código que puedo hacer en css pero quiero hacerlo en JS.

 .viewer-toolbar > ul > li::before{ margin: 10px 0px 0px 10px !important; } .viewer-play::before { background-position: -97px 3px !important; }

aquí está mi intento

 viewImage(event) { let viewer = new Viewer(event.currentTarget, { navbar: false, viewed() { debugger viewer.zoomTo(2); viewer['image'].style['border'] = "1px solid white"; for (let t = 0; t < viewer['toolbar'].childNodes[0].childNodes.length; t++){ let li = viewer['toolbar'].childNodes[0].childNodes[t]; if(li.className === 'viewer-play viewer-large'){ li.style.width = '46px'; li.style.height = '46px'; li.before.style.margin = '10px 0px 0px 10px'; // this my try but it not work }else{ li.style.width = '40px'; li.style.height = '40px'; } } } }); viewer.show(); }

Haga clic aquí para ver el jsfiddle

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!