Skip to content

Instantly share code, notes, and snippets.

@smat
Created January 31, 2013 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smat/4681195 to your computer and use it in GitHub Desktop.
Save smat/4681195 to your computer and use it in GitHub Desktop.
Positioning not working correctly in IE7 with hidden div
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="http://fgnass.github.com/spin.js/dist/spin.min.js"></script>
<script type="text/javascript">
function testbug() {
var target1 = document.getElementById('spin-here1');
var spinner1 = new Spinner().spin(target1);
var target2 = document.getElementById('spin-here2');
var spinner2 = new Spinner().spin(target2);
target2.style.display = 'block';
}
</script>
</head>
<body>
<h1>Testing broken IE7</h1>
<p>Spinner inside regular div</p>
<div style="border: solid black 1px; height: 64px; width: 64px;">
<div id="spin-here1" style="margin-left: 16px; margin-top: 16px;"></div>
</div>
<p>Spinner inside hidden div</p>
<div style="border: solid black 1px; height: 64px; width: 64px;">
<div id="spin-here2" style="margin-left: 16px; margin-top: 16px; display: none;"></div>
</div>
<button onclick="testbug();">Show spinner</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment