mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
#399 IE계열에서 select - option에 disabled 가 먹히질 않는 것을 자바스크립트로 적용하도록 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3659 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
72ac60d670
commit
27dbf11b67
1 changed files with 23 additions and 0 deletions
|
|
@ -940,3 +940,26 @@ var Base64 = {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/* select - option의 disabled=disabled 속성을 IE에서도 체크하기 위한 함수 */
|
||||
if(xIE4Up) {
|
||||
xAddEventListener(window, 'load', activateOptionDisabled);
|
||||
|
||||
function activateOptionDisabled(evt) {
|
||||
var sels = xGetElementsByTagName('select');
|
||||
for(var i=0; i < sels.length; i++){
|
||||
sels[i].onchange = function() {
|
||||
if(this.options[this.selectedIndex].disabled) {
|
||||
if(this.options.length<=1) this.selectedIndex = -1;
|
||||
else if(this.selectedIndex < this.options.length - 1) this.selectedIndex++;
|
||||
else this.selectedIndex--;
|
||||
}
|
||||
}
|
||||
if(sels[i].options[sels[i].selectedIndex].disabled) sels[i].onchange();
|
||||
|
||||
for(var j=0; j < sels[i].options.length; j++) {
|
||||
if(sels[i].options[j].disabled) sels[i].options[j].style.color = '#CCC';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue