# Need help with creating a menu with on-click animation in one of website sections

**URL:** https://forum.readymag.com/t/need-help-with-creating-a-menu-with-on-click-animation-in-one-of-website-sections/860
**Category:** Custom code
**Created:** [November 1, 2022, 11:37am UTC](https://forum.readymag.com/t/need-help-with-creating-a-menu-with-on-click-animation-in-one-of-website-sections/860 "2022-11-01T11:37:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MGembala](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@MGembala](https://forum.readymag.com/u/MGembala)
#### Post date: [November 1, 2022, 11:37am UTC](https://forum.readymag.com/t/need-help-with-creating-a-menu-with-on-click-animation-in-one-of-website-sections/860/1 "2022-11-01T11:37:01Z")

</div>

I have a problem that can probably be solved using a custom code, but I don’t know where and what to look for.

I have a page with several sections that animate on-scroll.

**In one of the sections, I want to have a menu on the left side with “Strategy”, “Product”, and “Brand” to choose from. When a user clicks on “Strategy”, “Product” or “Brand” a different text widget appears on the right.**

I tried with on-click animation but there is a problem with layer stacking – for example when text that goes with “Brand” is on a lower layer than text that goes with “Strategy” the first text won’t be visible after clicking “Brand” because “Strategy” text will be always on top.

I assume that I may need a custom CSS code, but I don’t know where and what to look for. I tried contacting Readymag support, but their answer was that on-click animations might come a bit limited for this use case and that they can recommend on-hover animation instead – unfortunately, I can’t take advantage of it – it has to be on-click.

I hope that some of you know what to do about this situation or guide me where to look. Thanks!

 ![Screenshot 2022-11-01 at 12.34.33](https://us1.discourse-cdn.com/flex015/uploads/readymag/original/1X/6540c8c9d8021bbd6361826c570077e6def24e5b.png)

---

<div class="post-metadata">

### Author: ![MGembala](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@MGembala](https://forum.readymag.com/u/MGembala)
#### Post date: [November 2, 2022, 4:06pm UTC](https://forum.readymag.com/t/need-help-with-creating-a-menu-with-on-click-animation-in-one-of-website-sections/860/2 "2022-11-02T16:06:01Z")

</div>

@HEADLESS.HORSE@neueMeta – guys, maybe you can help? I saw the “[multiple types of hover animations](https://forum.readymag.com/t/multiple-types-of-hover-animations/231)” thread and I am thinking about a pretty similar solution, but unfortunately, I can’t code it myself. I will be sooo grateful! 🙌🏼

---

<div class="post-metadata">

### Author: ![neueMeta](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.readymag.com/neuemeta/32/92_2.png) [@neueMeta](https://forum.readymag.com/u/neueMeta)
#### Post date: [November 8, 2022, 11:38am UTC](https://forum.readymag.com/t/need-help-with-creating-a-menu-with-on-click-animation-in-one-of-website-sections/860/3 "2022-11-08T11:38:41Z")

</div>

hey @MGembala,  
well, yes this is only possible within RM if you only have two sections, like “Strategy” and “Product”.

If you want to achieve it with three sections, you need to build a javascript or jquery function, that checks if a section is “open” right now and depending on what you click to fade in / out the desired section content.  
This is a basic structure as how a really easy approach could look like.  
The exact syntax for the code you have to figure out on your own. This only gives the idea of the method behind it:

```auto
on click on "strategy" {
if (strategycontent = visible) {
do nothing
}
if ("productcontent" = visible) {
productcontent.fadeout();
strategycontent.fadeIn();
}
if ("brandcontent" = visible) {
brandcontent.fadeout();
strategycontent.fadeIn();
}

}

on click on "product" {
if (productcontent = visible) {
do nothing
}
if ("strategycontent" = visible) {
strategycontent.fadeout();
productcontent.fadeIn();
}
if ("brandcontent" = visible) {
brandcontent.fadeout();
productcontent.fadeIn();
}

}

on click on "brand" {
if (brandcontent = visible) {
do nothing
}
if ("strategycontent" = visible) {
strategycontent.fadeout();
brandcontent.fadeIn();
}
if ("productcontent" = visible) {
productcontent.fadeout();
brandcontent.fadeIn();
}

}

```
