测试代码:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="GBK" />
	<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
	<title>jQuery Css Test</title>
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function(){
			alert(typeof jQuery('#csszindex').css('z-index'));
		});
	</script>
</head>
<body>
	<span >test</span>
</body>
</html>

弹出框显示信息:

IE8:

jQuery 取 css z-index 值在各种浏览器中的返回值

IE7:

jQuery 取 css z-index 值在各种浏览器中的返回值

IE6:

jQuery 取 css z-index 值在各种浏览器中的返回值

Firefox:

jQuery 取 css z-index 值在各种浏览器中的返回值

Chrome:

jQuery 取 css z-index 值在各种浏览器中的返回值

Opera:

jQuery 取 css z-index 值在各种浏览器中的返回值

后面的几个都一样,都返回的是String类型的。

相关文章:

  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
猜你喜欢
  • 2021-08-10
  • 2021-12-09
  • 2022-12-23
  • 2022-01-11
  • 2021-04-24
  • 2021-09-06
  • 2022-01-14
相关资源
相似解决方案