1

The error detailed Uncaught Error: no element is specified to initialize PerfectScrollbar
version: perfect-scrollbar v1.5.3

Error from my web browser console


pscroll.js

(function ($) {
  "use strict";

  *const ps = new PerfectScrollbar(".app-sidebar", {
    useBothWheelAxes: true,
    suppressScrollX: true,
    suppressScrollY: false,
  });
  const ps1 = new PerfectScrollbar(".header-dropdown-list", {
    useBothWheelAxes: true,
    suppressScrollX: true,
    suppressScrollY: false,
  });
  const ps2 = new PerfectScrollbar(".notifications-menu", {
    useBothWheelAxes: true,
    suppressScrollX: true,
    suppressScrollY: false,
  });
  const ps3 = new PerfectScrollbar(".message-menu-scroll", {
    useBothWheelAxes: true,
    suppressScrollX: true,
    suppressScrollY: false,
  });

  //P-scrolling
*})(jQuery);

pscroll-1.js

(function($) {
    "use strict";

    *const ps11 = new PerfectScrollbar('.sidebar-right', {
        useBothWheelAxes: true,
        suppressScrollX: true,
    });


*})(jQuery);

I marked the error line into *.
j08691
  • 204,283
  • 31
  • 260
  • 272
WreckitJeck
  • 15
  • 1
  • 7
  • can you post the HTML – BrokenWings Apr 19 '22 at 16:29
  • @BrokenWings hello sir thank you for the response. Im new to this Forum. I don't know if theres any format in snippet, so where I can post the html. but this is the link sir https://codepen.io/wreckitjeck2326/pen/abEXpEZ – WreckitJeck Apr 19 '22 at 16:51

1 Answers1

0

After you posted the html, the only class I could find within the document was app-sidebar. Can you confirm you are not missing these classes within the html?

header-dropdown-list notifications-menu message-menu-scroll sidebar-right

BrokenWings
  • 169
  • 12
  • I'd remove those classes in index, after I customize the template sir. will I remove also the parameter from scroll, scroll-1 js sir? – WreckitJeck Apr 20 '22 at 04:04
  • I also upload the code of perfect-scrollbar.js. I just noticed that the variable of app-sidebar, had a function in perfect-scrollbar. – WreckitJeck Apr 20 '22 at 04:10
  • Hello Sir, the error from the console are gone. Thank you for helping me to solve this problem sir. It only needs to remove the unnecessary parameters. Thank you sir, god bless. – WreckitJeck Apr 20 '22 at 04:18