Skip to content

Instantly share code, notes, and snippets.

@boucher
Created May 6, 2010 18:15
Show Gist options
  • Save boucher/392481 to your computer and use it in GitHub Desktop.
Save boucher/392481 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function load()
{
var foo = document.getElementById("foo"),
bar = document.getElementById("bar"),
baz = document.getElementById("baz");
baz.contentDocument.write("<!DOCTYPE html><html><head></head><body><div style='height:1000px; background-color:yellow;'></div></body></html>");
window.addEventListener("DOMMouseScroll", mouseWheel, true);
window.addEventListener("mousewheel", mouseWheel, true);
}
function mouseWheel(anEvent)
{
console.log("wheel: "+anEvent);
}
</script>
</head>
<body onload="load();">
<div id="foo" style="width:500px; height:300px; background-color:red;">
<div id="bar" style="width:400px; height:200px; top: 50px; left: 50px; position: absolute; background-color:blue;">
<iframe id="baz" style="width:100%; height:100%"></iframe>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment