私は最近、この開発者のサイトから jQuery ドロップダウンを実装しました: http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/ Firefox (私のサイトはhttp://www.ExpeditionerSafaris.comです)。
ただし、Internet Explorer では (もちろん)、li リンクは機能しません。
コードは次のとおりです。
function DropDown(el) {
this.dd = el;
this.initEvents();
}
DropDown.prototype = {
initEvents: function () {
var obj = this;
obj.dd.on('click', function (event) {
$(this).toggleClass('active');
event.stopPropagation();
});
}
}
$(function () {
var dd = new DropDown($('#dd'));
$(document).click(function () {
// all dropdowns
$('.wrapper-dropdown-5').removeClass('active');
});
});