Topic: $('.button-collapse').sideNav is not a function

jimscottjr free asked 4 years ago


*Expected behavior*Expect sideNav to be a function

Actual behavior$('.button-collapse').sideNav is not a function when page is loaded

*Resources (screenshots, code snippets etc.)*JS loaded just prior to body close:


Mateusz Łubianka staff answered 4 years ago


Hi @jimscottjr,

Did you initialize sidenav function inside the $( document ).ready() function? It should work if you use:

$(document).ready(function() {
    $(".button-collapse").sideNav();
});

Best,



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.12.0
  • Device: Macbook Pro
  • Browser: both Safari and Chrome
  • OS: macOS ctalina 10.15.2
  • Provided sample code: No
  • Provided link: No