jquery – 为什么z-index忽略位置:static?

看到这个评论 from jquery-ui
// Ignore z-index if position is set to a value where z-index is ignored by the browser
// This makes behavior of this function consistent across browsers
// WebKit always returns auto if the element is positioned

我看到jquery的zIndex()如果元素是position:static则返回0.

位置上不支持z-index:static? (它适用于我的Chrome,没有测试跨浏览器)

解决方法

因为position:static表示“忽略左,上,z-index等所有定位指令”.
'z-index'
Value:      auto | <integer> | inherit
Initial:    auto
Applies to:     positioned elements

http://www.w3.org/TR/CSS21/visuren.html#z-index

An element is said to be positioned if its ‘position’ property has a value other than ‘static’.

http://www.w3.org/TR/CSS21/visuren.html#positioned-element

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...