/    Sign up×
Community /Pin to ProfileBookmark

Add changes to HTML sections using JavaScript condition

Hello, I have a one section website that shows sections (about, services, …) when scrolling down (hiding the previous section).
How can I use JavaScript code to add CSS changes when each section is shown (changes like: show/hide a certain logo, change color of active text of the section in main menu, changing color of navigation menu, …?
What I mean : if this section is selected (using the menu or the nav bar) / scrolled to (mouse scrolling) , then do the CSS changes
Any help?

to post a comment
CSSHTMLJavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@VITSUSAApr 12.2021 — @Rock67#1630247 Can you please share a reference link with us to understand the exact requirements?
Copy linkTweet thisAlerts:
@Rock67authorApr 13.2021 — @VITSUSA#1630248

It's a website similar to this one https://bratsun.com/#hello , one section website and scroll down

Example: I want to change the color of active section text in the menu bar, so when you are in Services, "services" in the menu should be in different color ...
×

Success!

Help @Rock67 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...