Tickitto Docs

Handling IFrame Sizes

This section is intended as further guidance on optimizing the size of Tickitto's Ticket Selection Widget.

As a developer, you can use the below code snippet to resize the iframe and its contents according to the size of the ticket buyer's browser window.

function messageReceiver(event) {
const frameRef = document.getElementsByTagName('iframe')[0]
if (event.data.messageData != null) {
if (event.data.type === "NEW_HEIGHT") {
const newHeight = event.data.messageData.height
frameRef.setAttribute('height', newHeight)
}
}
}
//add post message listener
window.addEventListener("message", messageReceiver, false);