# How to apply transition on display?

**URL:** <https://community.weweb.io/t/how-to-apply-transition-on-display/3126>\
**Category:** Ask us anything\
**Created:** [June 19, 2023, 9:39pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126 "2023-06-19T21:39:13Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![RCS](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@RCS](https://community.weweb.io/u/RCS)\
**Post date:** [June 19, 2023, 9:39pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/1 "2023-06-19T21:39:13Z")

</div>

I have a button, when clicked changes a variable which makes a section visible. The section display (conditional display) is binded to that variable.

I want to make that section ease into display when it becomes visible.

I’m having trouble figuring out when this transition feature applies and how to apply it to a specific state change. The delay feature works when I use it, but not the ease.

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/3/311610f1bfe5fd82148baed8f1a64c262e07abed.png)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 19, 2023, 10:42pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/2 "2023-06-19T22:42:35Z")

</div>

Hey @RCS! [So you’d like to animate the display property](https://css-tricks.com/so-youd-like-to-animate-the-display-property/) ah? You found a very rare “bug” that is actually a very rare feature / exception of the web, so consider yourself lucky haha! In some cases, such as this, the transition does not work. You can not transition in display, and also from something like 100px to auto.

---

<div class="post-metadata">

**Author:** ![RCS](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@RCS](https://community.weweb.io/u/RCS)\
**Post date:** [June 20, 2023, 5:05pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/3 "2023-06-20T17:05:01Z")

</div>

Oh no way the delay function on display is a bug?

Opacity is a good way around it. Thanks for showing.

I also learned that ease doesn’t work when you use vh to auto. You need exact px numbers.

---

<div class="post-metadata">

**Author:** ![Jean](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jean/32/4106_2.png) [@Jean](https://community.weweb.io/u/Jean)\
**Post date:** [July 3, 2023, 7:12pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/4 "2023-07-03T19:12:36Z")

</div>

> [@Broberto](#):
>
> You found a very rare “bug” that is actually a very rare feature / exception of the web

Hi Broberto,  
Is this something related to all web dev or is it a specific weweb “bug” and there could be a fix later on? (I’m talking about moving from display: none to flex) . Do you have more literature about it maybe?  
Thanks for the workaround.

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [July 4, 2023, 2:31pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/5 "2023-07-04T14:31:09Z")

</div>

Hey Jean, it’s actually a “feature” of the web itself, you can’t apply transition in certain cases.

> **[So, you’d like to animate the display property | CSS-Tricks](https://css-tricks.com/so-youd-like-to-animate-the-display-property/)**
>
> The CSS Working Group gave that a thumbs-up a couple weeks ago. The super-duper conceptual proposal being that we can animate or transition from, say,

---

<div class="post-metadata">

**Author:** ![Jean](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jean/32/4106_2.png) [@Jean](https://community.weweb.io/u/Jean)\
**Post date:** [July 4, 2023, 2:59pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/6 "2023-07-04T14:59:18Z")

</div>

Hey Brobeto,  
Thanks a lot for the link, that was a great read and to the point.

---

<div class="post-metadata">

**Author:** ![yunus](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/yunus/32/3122_2.png) [@yunus](https://community.weweb.io/u/yunus)\
**Post date:** [July 6, 2023, 4:18pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/7 "2023-07-06T16:18:14Z")

</div>

Hey Broberto, is there another way to use on WeWeb to delay display of sections/objects. Display property is not the only way to do this in HTML universe. Objects don’t allow onLoad capability like pages which could be a solution. Also Opacity can be another solution but seems to be impossible due to same problem.

Anyone has any suggestions? I want to hide a section until its actual data is loaded, as it shows default data until it populate the actual content and it is not nice.

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [July 6, 2023, 4:34pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/8 "2023-07-06T16:34:20Z")

</div>

You can do this with conditional rendering, and listen to the data/the fetching state. Then display conditionally the div/section.

> **[Conditional rendering | Weweb documentation](https://docs.weweb.io/css-and-styling/conditional-rendering.html?_gl=1*haw2n8*_ga*MzYzOTA4NzEwLjE2ODY1NzM1NDg.*_ga_ESSLM0W0D8*MTY4ODY1ODgxNi44OC4xLjE2ODg2NjEyNDkuNTkuMC4w)**
>
> Learn about advanced conditional display

---

<div class="post-metadata">

**Author:** ![yunus](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/yunus/32/3122_2.png) [@yunus](https://community.weweb.io/u/yunus)\
**Post date:** [July 6, 2023, 5:59pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/9 "2023-07-06T17:59:50Z")

</div>

Static collections don’t get fetching state ☹ or else i couldnt find it…

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [July 6, 2023, 6:03pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/10 "2023-07-06T18:03:14Z")

</div>

Isn’t there even is\_fetched or something like that? Maybe you can listen to the array length of your collection, if it is 0 it means that there are no items fetched, otherwise you display the element. Could you screenshot me your collection in the editor? I’ve not used static collections yet))

---

<div class="post-metadata">

**Author:** ![yunus](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/yunus/32/3122_2.png) [@yunus](https://community.weweb.io/u/yunus)\
**Post date:** [July 6, 2023, 7:04pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/11 "2023-07-06T19:04:32Z")

</div>

I created a parameter and triggering it after a delay on page load which is giving me enough time to load the data, and showing loader while loading, hiding it and showing content after delay… worked fine…

only if we can put transition to those appearing and disappearing objects, would be great…

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [July 6, 2023, 8:37pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/12 "2023-07-06T20:37:28Z")

</div>

There are some cheats to make this work, but I don’t think it is worth the struggles)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [July 11, 2023, 4:13pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/13 "2023-07-11T16:13:38Z")

</div>

I’ll leave this here

> **[Animatable CSS properties - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)**
>
> CSS Animations and Transitions rely on the concept of animatable properties, and all CSS properties are animatable unless otherwise specified. Each property's animation type determines how values combine - interpolate, add, or accumulate - for this...

---

<div class="post-metadata">

**Author:** ![kapnevets](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@kapnevets](https://community.weweb.io/u/kapnevets)\
**Post date:** [November 9, 2023, 2:49am UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/14 "2023-11-09T02:49:14Z")

</div>

@Broberto Is there a way to also make the element not clickable when it “disappear”? I am trying to transform (on its X axis) and make the form “appear” on a click event on a button, then “hide” it when I want to remove it. But when I “hide” it, the form’s inputs are clickable, invisible, and the submission buttons still works and it takes space on the page.

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [November 9, 2023, 7:22am UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/15 "2023-11-09T07:22:08Z")

</div>

You can play with scale transform and overflow

---

<div class="post-metadata">

**Author:** ![kapnevets](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@kapnevets](https://community.weweb.io/u/kapnevets)\
**Post date:** [November 9, 2023, 1:03pm UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/16 "2023-11-09T13:03:01Z")

</div>

You are a genius and a friend. Thanks so much. The scale set to 0 and overflow set to hidden is what I needed.

---

<div class="post-metadata">

**Author:** ![sprocketeer](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@sprocketeer](https://community.weweb.io/u/sprocketeer)\
**Post date:** [January 3, 2024, 4:29am UTC](https://community.weweb.io/t/how-to-apply-transition-on-display/3126/17 "2024-01-03T04:29:09Z")

</div>

Curious about this same issue, but use case is a little different. Say I have a collection list of data, and I click a button to filter the set. The items change immediately, instantly, and I’d like to apply a fade or transition or something. Is that not possible? Would it work if I transition the opacity from 0.7 to 1.0 in 200 milliseconds or something?
