Closed merlinstardust closed 8 years ago
Ok, that is caused by the fallback to select a transition time for the off-canvas wrapper. Try setting the option for that directly and see if it still gives you issues.
new Foundation.OffCanvas($('selector'), {transitionTime: 500});
or
...data-off-canvas data-transition-time="500"...
I did the first option which got rid of the error. And fixed it.
Edit: I originally said it still wasn't working but it turns out I forgot a dash in data-off-canvas-wrapper
and only had data-offcanvas-wrapper
So it was working correctly the whole time? Or there's still an issue of accessing the computed style?
Just tried it without the transitionTime
fix and it did work. Apologies for the incorrect bug.
To prevent incorrect bug reports like this in the future, I think that it would be helpful if there was some console logging when a plugin can't find the correct data attributes
I think that's a great idea, care to write a pr that drops in the proper error handling in our try/catch init? :smile:
Absolutely glorious - I did not forget a dash - & was still getting this error. Adding a transition time fixed it. Real glad you goofed up y'all helped me out! :)
I'm using Meteor but I don't think that's the issue since I tried the same code in the regular console and got the same errors.
I tried doing both
$(document).foundation();
for the entire layout and I tried doingthis.offCanvas = new Foundation.OffCanvas($('#offCanvasLeft'));
but both cases give me the same stack trace (below).I also tried using a regular HTML non-jQuery element with
new Foundation.OffCanvas(document.getElementById('offCanvasLeft')
and that gave me this error