mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
selectbox option disabled관련 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4695 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
fd85eb471c
commit
cc7dd67ed2
1 changed files with 11 additions and 3 deletions
|
|
@ -857,10 +857,13 @@ if(xIE4Up) {
|
|||
var sels = xGetElementsByTagName('select');
|
||||
for(var i=0; i < sels.length; i++){
|
||||
var disabled_exists = false;
|
||||
var first_enable = new Array();
|
||||
for(var j=0; j < sels[i].options.length; j++) {
|
||||
if(sels[i].options[j].disabled) {
|
||||
sels[i].options[j].style.color = '#CCCCCC';
|
||||
disabled_exists = true;
|
||||
}else{
|
||||
first_enable[i] = first_enable[i]>-1? first_enable[i] : j;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -869,9 +872,14 @@ if(xIE4Up) {
|
|||
sels[i].oldonchange = sels[i].onchange;
|
||||
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--;
|
||||
|
||||
this.selectedIndex = first_enable[i];
|
||||
/*
|
||||
if(this.options.length<=1) this.selectedIndex = -1;
|
||||
else if(this.selectedIndex < this.options.length - 1) this.selectedIndex++;
|
||||
else this.selectedIndex--;
|
||||
*/
|
||||
|
||||
} else {
|
||||
if(this.oldonchange) this.oldonchange();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue