Skip to content
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

Conflict with Bootstrap 4 CSS #6

Open
MikeFB2764 opened this issue Dec 2, 2018 · 4 comments
Open

Conflict with Bootstrap 4 CSS #6

MikeFB2764 opened this issue Dec 2, 2018 · 4 comments

Comments

@MikeFB2764
Copy link

I am working on implementing scroll-spy w/ countUp on a site that uses Bootstrap 4. CountUp without scroll-spy works fine. Scroll-spy will only work when the css for Bootstrap is omitted. I am thinking there is some conflict (somehow), but wanted to see if this was a known issue or something fairly straightforward to override.

@inorganik
Copy link
Owner

The CSS shouldn't affect this scroll-spy at all - however if you are including the JS from bootstrap, that would likely override the window.onscroll handler which this lib uses. So make sure you aren't using the bootstrap JS and it should work... let me know.

@MikeFB2764
Copy link
Author

I will have to dig into this a little more. The Bootstrap.js library does not seem to have any impact. It's only when the Bootstrap.css file is present that scroll-spy does not work. I know this doesn't make sense, so there has to be something else that I'm missing.

@MikeFB2764
Copy link
Author

I will have to dig into this a little more. The Bootstrap.js library does not seem to have any impact. It's only when the Bootstrap.css file is present that scroll-spy does not work. I know this doesn't make sense, so there has to be something else that I'm missing.

Getting a little closer....scroll-spy in a nested grid seems to be having some trouble. If I move the element outside of the nested grid it seems to work, but for some reason once it's in the sub-grid, no luck. Not sure what to make of this yet.

@MikeFB2764
Copy link
Author

MikeFB2764 commented Dec 2, 2018

I will have to dig into this a little more. The Bootstrap.js library does not seem to have any impact. It's only when the Bootstrap.css file is present that scroll-spy does not work. I know this doesn't make sense, so there has to be something else that I'm missing.

Getting a little closer....scroll-spy in a nested grid seems to be having some trouble. If I move the element outside of the nested grid it seems to work, but for some reason once it's in the sub-grid, no luck. Not sure what to make of this yet.

Well...not sure if I am any closer, but the only way I can get it to work is to have an empty element preceding the element with the scroll-spy implemented. For example:

<h2></h2>
<h2 count-up id="person-count1" start-val="0" end-val="2536" duration="10" scroll-spy-event="elementScrolledIntoView" scroll-spy></h2>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants