Rumah  >  Artikel  >  hujung hadapan web  >  帮我看看下面那些代码那些属性是IE6不识别的,用什么替代_html/css_WEB-ITnose

帮我看看下面那些代码那些属性是IE6不识别的,用什么替代_html/css_WEB-ITnose

WBOY
WBOYasal
2016-06-24 12:12:211063semak imbas

$(function() {
$("#logo").append("");
//在ID为logo的标签里内部插入一个样式为hover的span
$('.hover').css('opacity', 0);
//设置hover的透明度为0
$('.hover').parent().hover(
function() {
$('.hover').stop().animate({opacity: '1'},750);
},
function() {
$('.hover').stop().animate({ opacity: '0'},750);
});
//这是一个JQ里常用的hover()效果。当鼠标放在class为hover的父元素
//上时。停止当前标签上的所有动画并执行后面的自定义效果?hover的透明度由0渐变成100%;当鼠标离开后反之。
});


回复讨论(解决方案)

http://stackoverflow.com/questions/3749328/how-to-fix-opacity-on-ie6

http://stackoverflow.com/questions/3749328/how-to-fix-opacity-on-ie6
那什么,我不会英文

引用 1 楼  的回复:

http://stackoverflow.com/questions/3749328/how-to-fix-opacity-on-ie6

那什么,我不会英文
不是吧....可以用fadein()..fadeout()..

引用 2 楼  的回复:

引用 1 楼  的回复:

http://stackoverflow.com/questions/3749328/how-to-fix-opacity-on-ie6

那什么,我不会英文

不是吧....可以用fadein()..fadeout()..
我想做的是一个渐变按钮,我用fadein()做过,但是效果很不好,现在这个效果是满意了,但是就IE6不兼容,想看看那毛病

opacity: '1',好像不可以把  你看看用IE的filter

opacity: '1',好像不可以把  你看看用IE的filter
jquery可以达到跨浏览器。。
display: inline-block在span上加上这个试试。。
http://stackoverflow.com/questions/1375646/jquery-animate-opacity-doesnt-work-properly-on-ie
(你看不懂英文真的好纠结。。)

引用 5 楼  的回复:

opacity: '1',好像不可以把  你看看用IE的filter

jquery可以达到跨浏览器。。
display: inline-block在span上加上这个试试。。
http://stackoverflow.com/questions/1375646/jquery-animate-opacity-doesnt-work-properly-on-……
还是不可以,IE6还是没有反应,一直默认那张图片

奇怪,想span这样的内嵌标签(display:inline),jquery设置透明度无效。。。

解决的方法有:
法1. 设置span的css属性:display:block (这样span变成了行显示了)
法2. 设置css:float:left (保留了span内嵌形式:宽高度)

法2 示例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script><script type="text/javascript">$(function() {	$("#logo").append("<span class='hover'>span1</span>");		//在ID为logo的标签里内部插入一个样式为hover的span	$('.hover').css('opacity', 0);		//设置hover的透明度为0	$('.hover').parent().hover(		function() {			$('.hover').stop().animate({opacity: '1'},750);		},		function() {			$('.hover').stop().animate({ opacity: '0'},750);	});		//这是一个JQ里常用的hover()效果。当鼠标放在class为hover的父元素	//上时。停止当前标签上的所有动画并执行后面的自定义效果?hover的透明度由0渐变成100%;当鼠标离开后反之。});	</script><style type="text/css">.hover{border:solid 1px red; background:orange; float:left;}</style></head><body><div id="logo" style="background:yellow; width:300px; height:100px;"></div></body></html>


jquery的方法是兼容的
楼主贴的没问题。

你 可以把发现问题的代码贴出来,大家看看

jquery的方法是兼容的
楼主贴的没问题。

你 可以把发现问题的代码贴出来,大家看看

我测试过。。。

jquery 设置span透明度,ie8 无效!!! 
ie6.0,7.0(IETester)和其他浏览器是有效的...

楼主是机器上安装的ie8?

这边ietester测试 确实有这个问题
发现去掉了dtd就可以了,但是这样不现实。。。

也可以用的变态的方法,让ie8 以ie7的方式运作。。。

<!DOCTYPE HTML><html>	<head>		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />		<meta charset="gb2312" />		<title></title>			<script src="http://code.jquery.com/jquery-latest.js"></script>		<style>			span {				background:#900;			}		</style>	</head>	<body>		<span>			123		</span>		<script>			$('span').animate({				opacity: '.1'			})		</script>	</body></html>





也有人遇到这个问题
http://stackoverflow.com/questions/7632686/ie8-opacity-issue

楼 上是机器上安装的ie8?

是啊:
ie8 + ietester ,而且用两台电脑看过


nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn