/
githubmirror
/
amphtml
Обзор
Документация
Войти
/
githubmirror
/
amphtml
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/multiple-docs.html
50 строк
1 KB
Caroline Liu
Apply bulk transform to html tags (#34836)
15 июн 2021, 21:07
Не верифицирован
15 июн 2021, 21:07
3ace35c
Код
Авторство
О чём код?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Load AMP documents</title> <style> #frames { position: relative; } iframe { position: absolute; background-color: white; } </style> </head> <body> <select id=version> <option value=".max">Original (babel.js) <option value=".min">Minified (closure) <option value>prod (closure) </select> <button id=load>Load doc</button> <div id=frames></div> <script> (function() { var load = document.getElementById('load'); var frames = document.getElementById('frames'); var count = 0; load.onclick = function() { var iframe = document.createElement('iframe'); iframe.src = './article.amp' + getVersion() + '.html#log=0'; iframe.width = 320; iframe.height = window.innerHeight - 100; iframe.style.top = (count * 20) + 'px'; iframe.style.left = (count * 20) + 'px'; frames.appendChild(iframe); count++ }; function getVersion() { var v = document.getElementById('version'); return v.options[v.selectedIndex].value; } })(); </script> </body> </html>