It needs to be laid out differently for IE 8 and less. Here's one way:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
span {display: inline-block
;}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("span").fadeIn(3000);
});
});
</script>
</head>
<body>
<button>Fade in</button>
<span style="display: none;"
>This is some text.</span>
</body>
</html>
Here's another:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
button, span {display: block; float: left; margin-right: 0.5em;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("span").fadeIn(3000);
});
});
</script>
</head>
<body>
<button>Fade in</button>
<span style="display: none;">This is some text.</span>
</body>
</html>
There may be other ways. Essentially though I believe it needs to be display block (will probably work in IE 6+, jQuery doesn't support IE less than 6) or inline-block (may break down in IE 7 or 6 due to those browsers not rendering it inline). In ordinary javascript when applying filters (fade is accomplished in IE 8 and less via a proprietary IE filter) to an element, we are told that the element "must have layout". The zoom property is often used for that. I tried it here though and it did not work.
For more on what MS says constitutes 'layout', see:
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
Bookmarks