Удаление параметра из выбора и добавление его в другой

Итак, у меня есть этот код, который работал нормально. Недавно я обновил свой jQuery с 1.4.4 до 1.5.2, и, похоже, это перестало работать. Однако я пробовал код с 1.4.4. и 1.3.2, и там он тоже не будет работать.

Это сработало. Я не могу понять, почему это не так. Любая помощь?

Изменить: начало и конец являются аргументами с текстом ID элемента select .


var selectedIndex = document.getElementById(start).selectedIndex; // get the selected index from the correct select box

if (selectedIndex != -1) {      // if something is selected, do the following:
       var selectedElement = document.getElementById(start).options[selectedIndex]; // get the element that's selected

       if (selectedIndex == (document.getElementById(start).options.length - 1) && selectedIndex != 0) {
           selectedIndex--; // if we're at the bottom of the list, set our selectedIndex variable to the one right before it
       }

       $("#" + start).remove(selectedElement);  // remove the selected element from the start side          
       $("#" + end).append(selectedElement);        // and add it to the end of the ending side
}

Здесь '

Кажется, я не могу найти событие, которое срабатывает, когда плитки загружаются, поэтому на снимке экрана фактически будут изображения вместо пустого серого фона.

6
задан Black Frog 3 May 2011 в 01:17
поделиться