http://www.dynamicdrive.com/ で拾えるddsmoothmenu.jsだけど、残念ながらIE6には未対応である。
IE6で動かしたところ、JQueryのanimateが微妙に動かないためにドロップダウンメニュー表示がされなかったりするケースがあるので、animateを置換えて無理矢理動作させる。
ついでにコンボボックスのZ-IndexがIE6だとおかしい(有名なやつ)ので、それも非表示っていう大味な対処をする。
ドロップダウンメニュー表示のところ
$targetul.css({left:menuleft+"px",width:header._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, ddsmoothmenu.transition.overtime)
を
if (smoothmenu.detectie6) {
if (smoothmenu.detectie6) $('select').each(function(){ $(this).css('visibility', 'hidden'); })
$targetul.css({left:menuleft+"px", width:header._dimensions.subulw+'px', display:'block', visibility:'visible'})
} else {
$targetul.css({left:menuleft+"px",width:header._dimensions.subulw+'px'}).animate({height:'show',opacity:'show'}, ddsmoothmenu.transition.overtime)
}
ドロップダウンメニュー非表示のところ
$targetul.animate({height:'hide', opacity:'hide'}, ddsmoothmenu.transition.outtime)
を
if (smoothmenu.detectie6) {
$('select').each(function(){ $(this).css('visibility', 'visible'); })
$targetul.css({display:'none', visibility:'hidden'})
} else {
$targetul.animate({height:'hide', opacity:'hide'}, ddsmoothmenu.transition.outtime)
}
IE6早くなくなんないかねー