In order to achieve the fade effect instead of callbacks, which don’t exist in CSS, you can use transition-delay
property:
1 2 3 4 5 6 7 8 9 10 |
#selector { overflow: hidden; /* Hide the element content, while height = 0 */ height: 0; opacity: 0; transition: height 0ms 400ms, opacity 400ms 0ms; } #selector.visible { height: auto; opacity: 1; transition: height 0ms 0ms, opacity 600ms 0ms; } |
Source: https://stackoverflow.com/