fullPage.js icon indicating copy to clipboard operation
fullPage.js copied to clipboard

Change default 'active' class to 'fp-active'

Open netes opened this issue 8 years ago • 8 comments

Hey, I'm wondering... wouldn't be better to change default active class to fp-active to prevent namespace conflicts? For example with Bootstrap active class. I ran into this issue today and changed it.

P.S. Thanks for the great addon!

netes avatar Apr 11 '16 19:04 netes

Can you specify where exactly is the conflict with bootstrap? Which element in bootstrap uses the active class that can be used at the same time for sections or slides?

Or is it only the active class in the navigation list element what conflicts with it?

If we are talking about the 2nd case, then we can create a new class for the navigation elements. Otherwise then you will have to wait for fullpage.js v3 for that. Changing the "active" class applied to sections and slides is a major change that can break many websites using fullpage.js. Those kind of changes are only applied on new versions.

alvarotrigo avatar Apr 11 '16 19:04 alvarotrigo

It seems that this PR was a little premature, sorry for that. I made some investigation and it seems that the problem cause was custom .active class without any specificity. I changed that class and everything is fine now. But all in all - I think it would be nice to add option to customize active class name :)

netes avatar Apr 11 '16 19:04 netes

it seems that the problem cause was custom .active class without any specificity.

I'm not able to see any CSS style applied by Bootstrap 3.3.6 to the active class alone. You can verify it in this jsfiffle by using the dev tools.

I think it would be nice to add option to customize active class name

I agree, for version 3 probably :)

alvarotrigo avatar Apr 11 '16 19:04 alvarotrigo

I'm not able to see any CSS style applied by Bootstrap 3.3.6 in the active class alone.

Yes, exactly. Someone added custom class directly to Bootstrap CSS files 😕

netes avatar Apr 11 '16 19:04 netes

Right I see. I'll leave the PR open in case I merge it for v3.

alvarotrigo avatar Apr 11 '16 19:04 alvarotrigo

Great, thanks!

netes avatar Apr 11 '16 19:04 netes

You could also make a prop for it where users can define their own custom active-class. That way, you can just keep the current class, and make people customize if they want, and it won't break any existing sites.

BossElijah avatar Sep 01 '22 08:09 BossElijah

You could also make a prop for it where users can define their own custom active-class. That way, you can just keep the current class, and make people customize if they want, and it won't break any existing sites.

Yeah, that could be a good approach.

alvarotrigo avatar Sep 01 '22 09:09 alvarotrigo