Skip to content
Advertisement

Hide two blocks at the same time

I have a method on a page that opens and hides a scrolling block in certain places

JavaScript

Now it turns out that in my sideMenu there is only one block, but I want to add another one and so that they hide and open together

This is how the code should look like after adding the block

JavaScript

But now I can’t make them both hide

I am trying to do the following in js

JavaScript

But everything works incorrectly and nothing is hiding at all

Advertisement

Answer

I am still not much clear what exactly the problem but as I can understand you facing issues in the show and hiding the element. this code is not working

JavaScript

you just need to update it with

JavaScript

here is working demo

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement