-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error "You must give your menu items a class of 'scrollactive-item' in order to track them." #2
Comments
Can you please provide a fiddle with the error? I'll give it a better look later in the night to see if it's an actual bug with the plugin :) |
Sorry I don't think I'm able provide a js fiddle that reflects my current setting. I'm using scroll active inside a vue component that isn't root. |
Yes, that might be the problem, I'll try to debug this later based on your settings, but as far as I've tested, it should work with dynamic items, but I didn't try with v-for. I'll perform some tests and let you know if I find something, thanks for the response :) |
Thank you for the help! |
Ok, I've managed to reproduce your error. It fires the error message but works correctly after that, I think the problem you have is because you're using code inside I'll patch it soon to remove the error when there aren't elements inside the component yet (as in your case when it's rendered by AJAX), but I think you might be just fine doing as I said. Let me know if it works :) |
Thank you and sorry for the typo, I did use I have some spaces in the ID string, will that cause any problem? it jumps fine under |
Oh, that's probably what's going on here, you must not have any spaces in an ID using HTML. Try running Let me know if it works :) Sent from my Motorola Moto G (4) using FastHub |
I've replaced all the spaces with dashes, still the same error. |
Ohhh, now that makes sense, this inner div was not expected, I just released a quick fix for that, update the plugin and it should work with no more problems regarding that :) But keep in mind not to use the IDs with space as that will cause unexpected behavior not from the plugin, but the selector won't find it. Hope everything works now! |
Great, I'll keep that in mind, thank you! |
Hi, I'm new to VueJS.
I tried to use it but it gives me
Error: You must give your menu items a class of 'scrollactive-item' in order to track them.
But I already gave the class name to the
<a>
tag,I tried to call the
dynamicItemsFunction
after but the same error persists.When the link is clicked, I get this error
Cannot read property 'substr' of undefined
from:
var targetDistanceFromTop = this.getOffsetTop(document.getElementById(event.target.hash.substr(1)));
below is my html code,
Thank you for your help!
The text was updated successfully, but these errors were encountered: