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

(编辑:jimmy 日期: 2024/10/11 浏览:2)

测试代码:
复制代码 代码如下:
<!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="/UploadFiles/2021-04-02/jquery.js"><script type="text/javascript">
jQuery(document).ready(function(){
alert(typeof jQuery('#csszindex').css('z-index'));
});
</script>
</head>
<body>
<span id="csszindex" style="z-index:100px;">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类型的。