当我使用jQuery设置元素';在IE6或IE7中,它的不透明度似乎是;溢出:隐藏";。为什么?
考虑以下HTML:当我使用jQuery设置元素';在IE6或IE7中,它的不透明度似乎是;溢出:隐藏";。为什么?,jquery,css,cross-browser,internet-explorer-7,opacity,Jquery,Css,Cross Browser,Internet Explorer 7,Opacity,考虑以下HTML: <!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> div { position: relative; width: 200px; height: 200px;
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
div {
position: relative;
width: 200px;
height: 200px;
background: #ff0;
}
span {
position: absolute;
width: 200px;
height: 200px;
background: #f00;
top: 100px;
left: 100px;
}
</style>
</head>
<body>
<div><span></span></div>
</body>
</html>
现在输出如下:
我怎样才能避免这种情况
编辑:它也发生在IE6中。我发现,如果您清空
过滤器
属性,问题就会消失
$('div').css('opacity', '1').css('filter', '');
或
$('div').css('opacity', '1').css('filter', '');
$('div').animate({ opacity: '1' }, function() {
$(this).css('filter', '')
});