52. z
z-index
position: absolute|relative|fixed
Stack Level :
Stacking Context : x
z-index auto stacking context
z-index auto box stack level ( IE6/7 )
y
A. z-index:1 A. z-index:auto
B. z-index:999 B. z-index:999
C. z-index:1
C. z-index:1
A, C stacking context A z auto stack level
A B B z C B A B z C C
IE6/7
62. Scope Chains
var x = 10; var x = 10;
function foo() { (function () {
alert(x); var x = 20;
}
function foo() {
(function () { alert(x);
var x = 20; }
foo();
})(); foo();
})();
63. with, try-catch scope chains
function addImageTitle(options) {
try {
var root = document.getElementById('content'),
images = root.getElementsByTagName('img');
for (var i = 0, len = images.length; i < len; i++) {
images[i].addEventListener('mouseover', function(e){
this.title = this.src;
}, false);
}
catch(error) {
log(error);
}
}
Activation Object
addImageTitle Scope Chains this window
[[Scope]] 0 arguments [items]
1 root undefined
images undefined
i undefined
len undefined
Global
document (object)
window (object)
navigator (object)
64. Variable Object
document (object)
Activation Object
try-catch Scope Chains this window
[[Scope]] 0 arguments [items]
1 root undefined
2 images undefined
i undefined
len undefined
Global
document (object)
window (object)
navigator (object)
Activation Object
this img
arguments [items]
e (event)
Activation Object
Event Handler Scope Chains this window
[[Scope]] 0 arguments [items]
1 root undefined
2 images undefined
i undefined
len undefined
Global
document (object)
window (object)
navigator (object)