Skip to content

Instantly share code, notes, and snippets.

@curtisj44
curtisj44 / CHANGELOG.md
Created July 27, 2021 16:32
Changelog Template
info:
title: test
version: 1.0.0
consumes:
- application/json
produces:
- application/json
swagger: '2.0'
securityDefinitions:
keystone:
@curtisj44
curtisj44 / match-iframe-height.js
Last active April 21, 2022 21:34
Responsive Test - Match iframe height to height of page contents
const setFrameHeight = (frameElement, index) => {
frameElement.style.height = 'unset';
const iframeElement = document.querySelectorAll('iframe')[index];
const targetHeight = `${ iframeElement.contentWindow.document.body.scrollHeight }px`;
iframeElement.style.height = targetHeight;
}
document.querySelectorAll('.frame').forEach((frameElement, index) => setFrameHeight(frameElement, index));