Bootstrap Nav Walker - Hover Drop down stopped working suddenly

606 Views Asked by At

My nav was working just fine, when I tried it this morning, the parent nav that has children won't drop down on hover like it did before and also the parent nav links stopped working? Weird. I checked my code in the class-wp-bootstrap-navwalker.php and everything is the same?

 if ( isset( $args->has_children ) && $args->has_children && 0 === $depth && $args->depth > 1 ) {
    $atts['href'] = ! empty( $item->url ) ? $item->url : '';
    $atts['data-toggle']   = 'dropdown';
    $atts['aria-haspopup'] = 'true';
    $atts['aria-expanded'] = 'false';
    $atts['class']         = 'dropdown-toggle nav-link';
    $atts['id']            = 'menu-item-dropdown-' . $item->ID;
} else {
    $atts['href'] = ! empty( $item->url ) ? $item->url : '#';

JS:

  $('.navbar .dropdown').hover(function() {
      $(this).find('.dropdown-menu').first().stop(true,true).delay(250).slideDown();

      }, function() {
      $(this).find('.dropdown-menu').first().stop(true, true).delay(100).slideUp();

      });

      $('.navbar .dropdown > a').click(function(){
      location.href = this.href;
      });`

enter image description here

I have no clue what happened, or what I can do to fix where you hover over items that have children, it should fire the dropdown. Any help will be appreciated. Thank you.

0

There are 0 best solutions below