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

174
Views
Agregar estilo a un elemento #document de iFrame

Así que estoy un poco atascado y estoy buscando a ver si alguien me puede ayudar, así que tengo el siguiente código jQuery:

 let VimeoBlock = function($element) { function init() { adjustPositioning(); } function adjustPositioning() { const classList = $element.attr('class'); if (classList.indexOf('alignwide') > -1) { const vimeo_iframe = $element.find('iframe'); console.log(vimeo_iframe); } } return { init: init, } } $(document).ready(function () { $('.wp-block-embed-vimeo').each(function (i, ele) { (new VimeoBlock($(ele))).init(); }); });

console.log(vimeo_iframe); genera los siguientes elementos cuando puedo acceder al índice iFrame con sus propiedades:

ingrese la descripción de la imagen aquí

Puedo apuntar al iFrame , pero quiero poder apuntar a la clase principal dentro del iFrame . ¿Cómo haría esto y agregaría CSS a esa clase?

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Dado que no puede hacer esto para el estilo del iframe si tiene un origen diferente, no hay solución en este caso. Sin embargo, si fuera el mismo dominio o un iframe con una estructura interna, podría hacerlo así:

 document.getElementById("youriframeid").contentDocument.querySelector("yourselector").style.display = 'none';

Tenga en cuenta que he usado selectores ficticios y un estilo ficticio, puede usar el suyo en su lugar.

about 4 years ago · Juan Pablo Isaza Report
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!