(☞ຈل͜ຈ)☞ Главная  Статьи  Загрузчик Домой

Ok!
Ok!
152
$('[name=docviewer]').show(200, function(){$(document).on('click', function(e){
                    $("#docviewer").hide()
                })});
iframe close, закрыть iframe10900После показа iframe закрыть его по щелчку снаружи
90
center iframe {
    width: 100%;
    height: calc(100vw * 9 / 16 );
}
iframe, youtube, height120Установить размер iframe видео с Youtube, подогнать его под мобильный размер. При условии, что видео 100% ширны.
22
// Create an iframe:
const iframe = document.createElement('iframe');

// Put it in the document (but hidden):
iframe.style.display = 'none';
document.body.appendChild(iframe);

// Wait for the iframe to be ready:
iframe.onload = () => {
  // Ignore further load events:
  iframe.onload = null;

  // Write a dummy tag:
  iframe.contentDocument.write('<streaming-element>');

  // Get a reference to that element:
  const streamingElement = iframe.contentDocument.querySelector('streaming-element');

  // Pull it out of the iframe & into the parent document:
  document.body.appendChild(streamingElement);

  // Write some more content - this should be done async:
  iframe.contentDocument.write('<p>Hello!</p>');

  // Keep writing content like above, and then when we're done:
  iframe.contentDocument.write('</streaming-element>');
  iframe.contentDocument.close();
};

// Initialise the iframe
iframe.src = '';
iframe vs link1755Возможный способ ускорения загрузки через Javascript