我有這樣的代碼,其尋找一個onchange事件:變更事件未被識別?
//Create destination switch
$('#regionselect').change(function(){
var selected = $(this).find(':selected');
$('.optionvalue').fadeOut(function(){
$('.optionvalue').html(selected.html()).fadeIn()
.attr('class', 'optionvalue '+selected.val());
});
var count = $('.countrylist').length;
$('.countrylist').slideUp(function(){
if(!--count) {
$('.'+selected.val()).slideDown();
}
});
});
它完美的位置: http://jsfiddle.net/XfPv7/1/
誰能幫助?
想法是,當選擇下拉選項時,它會顯示目的地內的相對隱藏div。 – Andy 2011-06-11 13:40:24
你不實際使用'#regionselect'元素。有一個美化下拉框('#sarea8')被插入到文檔中,而'#regionselect'放逐300到左邊。 – lonesomeday 2011-06-11 13:42:01
如何在代碼更改時運行代碼? – Andy 2011-06-11 13:44:42