Py学习  »  Jquery

如何在jquery中实现fa-bar

MUHAMMAD USAMA • 4 年前 • 234 次点击  

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 足总 足总杆 而不是被选中 . 请给我相应的指导

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/52919
 
234 次点击