jquery
我正在尝试编辑它,以便在单击
fa
fa-bar
但是经过这么多的尝试我还是做不到
(function() {
var $menu = $('.navigation nav'),
optionsList = '<option value="" selected>Go to..</option>';
$menu.find('li').each(function() {
var $this = $(this),
$anchor = $this.children('a'),
depth = $this.parents('ul').length - 1,
indent = '';
if (depth) {
while (depth > 0) {
indent += ' - ';
depth--;
}
}
$(".nav li").parent().addClass("bold");
optionsList += '<option value="' + $anchor.attr('href') + '">' + indent + ' ' + $anchor.text() + '</option>';
}).end()
.after('<select class="selectmenu">' + optionsList + '</select>');
$('select.selectmenu').on('change', function() {
window.location = $(this).val();
});
})();
在这个
jquery公司
,我的导航栏将显示选定的
div
足总
足总杆
而不是被选中
. 请给我相应的指导