英 [??ndeks]? ?美 [??n?d?ks]??

n.索引;<數(shù)>指數(shù);指示;標(biāo)志

vt.給…編索引;把…編入索引;[經(jīng)濟(jì)學(xué)]按生活指數(shù)調(diào)整(工資、價(jià)格等)

vi.[機(jī)械學(xué)]轉(zhuǎn)位

第三人稱單數(shù): indexes 復(fù)數(shù): indices indexes 現(xiàn)在分詞: indexing 過(guò)去式: indexed 過(guò)去分詞: indexed

javascript zIndex屬性 語(yǔ)法

作用:設(shè)置元素的堆疊順序。

語(yǔ)法:Object.style.zIndex=auto|number

注釋:元素可擁有負(fù)的 z-index 屬性值。Z-index 僅能在定位元素上奏效(例如 position:absolute;)

javascript zIndex屬性 示例

<html>
<head>
<style type="text/css">
#img1
{
position:absolute;
left:0px;
top:0px;
z-index:-1
}
</style>
<script type="text/javascript">
function changeStackOrder()
{
document.getElementById("img1").style.zIndex="1";
}
</script>
</head>
<body>

<h1>This is a Heading</h1>

<img id="img1" src="http://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg" width="100" height="180">

<p>Default z-index is 0. Z-index -1 has lower priority.</p>

<input type="button" onclick="changeStackOrder()" value="Change stack order" />

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例