Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <figure class="class"><iframe src="src" width="xxx" height="xxx"></iframe></figure>
  2.  
  3. <figure class="class"><iframe><iframe src="src" width="xxx" height="xxx"></iframe><iframe></figure>
  4.  
  5. foreach ($iframes as $iframeViejo) {
  6. //Crear un nuevo iframe y asignar el src
  7. $iframeMainn = $doc->createElement('iframe');
  8. $iframeNuevo->setAttribute('src', $iframeViejo->getAttribute('src'));
  9. $iframeNuevo->setAttribute('width','560');
  10. $iframeNuevo->setAttribute('height','615');
  11. //Crear un nuevo figure y agregarle el nuevo iframe
  12. $figureNuevo = $doc->createElement('figure');
  13. $figureNuevo->setAttribute('class','op-interactive');
  14. $figureNuevo->appendChild($iframeNuevo);
  15. //reemplazar viejo por nuevo
  16. $iframeViejo->parentNode->replaceChild($figureNuevo, $iframeViejo);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement