Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <div class="container">
    <section>
      <p>Some stuff in here.</p>
    </section>
    <section>
      <p>Some other stuff.</p>
    </section>
  </div>
  <iframe id="myIframe"></iframe>
</body>
</html>
 
.container {
  background: #FEFEFE;
  padding: 30px;
}
.container > section {
  border: 1px dashed black;
  padding: 15px;
}
.container > section > p {
  border: 1px dashed black;
  padding: 15px;
}
 
var myIframe = document.getElementById('myIframe');
window.addEventListener('click', resizeIframe);
window.addEventListener('scroll', resizeIframe);
window.addEventListener('resize', resizeIframe);
myIframe.contentWindow.addEventListener('click', resizeIframe);
function resizeIframe() {
  console.log('resize!');
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers