Created
February 3, 2012 07:13
-
-
Save hoatle/1728663 to your computer and use it in GitHub Desktop.
js closure usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0; i < this.allCommentSize; i++) { | |
(function(i) { | |
//when this element is displayed | |
if (uiActivity.commentBlockEls[i]) { | |
Util.addEventListener(uiActivity.commentBlockEls[i], ['mouseover', 'focus'], function(evt) { | |
uiActivity.deleteCommentButtonEls[i].className = 'CloseContentBoxHilight'; | |
}, false); | |
Util.addEventListener(uiActivity.commentBlockEls[i], ['mouseout', 'blur'], function(evt) { | |
uiActivity.deleteCommentButtonEls[i].className = 'CloseContentBoxNormal'; | |
}, false); | |
} | |
})(i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment