<iframe id="embedPanoMoment" pano="PanoMoments" allowfullscreen="1" allow="vr" frameBorder="0" width="420" height="320" scrolling="no" src="http://localhost:3000/embed/5b2e9e2304d03344f01d8475"></iframe>
<script type="text/javascript">
// This Javascript handles responsize sizing of the iFrame if the Width/Height parameters are set in percentages. // Note this will only work with 1 PanoMoment per page. // If you have multiple PanoMoment iFrames on a single page you'll need to modify this code. var iFrame = document.getElementById("embedPanoMoment"); var originalHeight = parseFloat(iFrame.height); var originalWidth = parseFloat(iFrame.width); // Only resize if iFrame size is defined as a percentage or not set at all. if ((iFrame.width.indexOf("%") > -1 || iFrame.height.indexOf("%") > -1) || (!iFrame.width && !iFrame.width)) { window.addEventListener('resize', function(event){ setIFrameSize(); }); setIFrameSize(); } function setIFrameSize() { // Set the iFrame size to the parent element's size if specified, else set to screen size. if (iFrame.parentElement.style.width && originalWidth) { iFrame.style.width = (originalWidth / 100 ) * iFrame.parentElement.style.width; } else { iFrame.style.width = window.innerWidth; iFrame.width = window.innerWidth; } if (iFrame.parentElement.style.height && originalHeight) { iFrame.style.height = (originalHeight / 100 ) * iFrame.parentElement.style.height; } else { iFrame.style.height = window.innerHeight; iFrame.height = window.innerHeight; } }
</script>
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.