jQuery擷取css z-index在各種瀏覽器中的傳回值

來源:互聯網
上載者:User

測試代碼: 複製代碼 代碼如下:<!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 id="csszindex" style="z-index:100px;">test</span>
</body>
</html>

彈出框顯示資訊:

IE8:

IE7:

IE6:

Firefox:

Chrome:

Opera:

後面的幾個都一樣,都返回的是String類型的。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.