简体   繁体   中英

Uncaught Error: no element is specified to initialize PerfectScrollbar

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 *.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM