Closed dpetratsch closed 3 years ago
Can you please state more details, whats your dev environment, how are you initiating it?
Yes sure:
Windows 10 with Chrome Version 86.0.4240.111 hcOffcanvas 6.04 via NPM jQuery V 3.5.1
I tried initiating with both methods exactly as described in the docs:
Vanilla:
document.addEventListener('DOMContentLoaded', function() {
var Nav = new hcOffcanvasNav('#main-nav', {
disableAt: 1024,
customToggle: '.toggle',
navTitle: 'All Categories',
levelTitles: true,
levelTitleAsBack: true
});
});
and
jQuery:
jQuery(document).ready(function($) {
$('#main-nav').hcOffcanvasNav({
disableAt: 1024,
customToggle: $('.toggle'),
navTitle: 'All Categories',
levelTitles: true,
levelTitleAsBack: true
});
});
Both methods lead to the same error when initiating:
Thanks! Daniel
If you are using NPM, are you also using some kind of compiler for your scripts like Gulp, Babel etc? How are you including the script exactly?
Yes i'm using gulp to merge my scripts together - but without any transpiler or compression, just a plain merge so this should not be the source of the problem.
I already included the Script directly from the NPM folder without any modification which leads to the same error. The script is included via Githubissues.
Hey there,
i just cant get this plugin to work - i'm always getting the same error:
Uncaught TypeError: hcOffcanvasNav is not a constructor
Its the same with vanilla and jQuery.
My version is: 6.0.4
Thanks for any help. Daniel