Topic: looks like a Bug in line 3761 of mdb.js pro asked 7 years ago

If there is no element with "navbar" class, the original code would cause an error when I scroll the screen because $(."navbar").offset() is null. //jQuery to collapse the navbar on scroll $(window).scroll(function () { if ($(".navbar").offset().top > 50) { $(".navbar-fixed-top").addClass("top-nav-collapse"); } else { $(".navbar-fixed-top").removeClass("top-nav-collapse"); } To fix this I put everything in the function inside the following if and the error is gone now. Please check . /*bug fix */ if($(".navbar").offset()){} /*bug fix*/ }); I am considering buying a corporate license and this kind of issue concerns me. Thanks Don

Michal Szymanski staff answered 7 years ago

Hi, we've already noticed that bug and it will be fixed with the next MDB release. Anyway thank you for the information.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.


Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No