When the page loads, the div design makes the animation starts below. If I page down, the div animation already starts.
I would like an code that the animation just appear when shows by the page.
I can’t write the code from memory; it’s been several years since I’ve hand-coded web pages.
However, a JavaScript event listener will likely be necessary to monitor for a scroll event that triggers the CSS animation. When the user scrolls down the page, the script would calculate the current position of the scroll relative to the bottom of the page. Once the user scrolls to a specified distance from the bottom, the script would trigger the CSS transition.
Coding JavaScript has never been my strong suit anyway. You might want to Google “JavaScript event listener”.
I just tried it in Chrome, Safari, Opera, Firefox, DuckDuckGo, and Edge. It works exactly as you described it should.
The bottom DIV and animation script don’t load until the user scrolls down to the point where it would normally be visible. At that point, the JavaScript Event Listener is triggered, which causes the DIV to fade in and move up.
Is that not what you want it to do?
Eu acabei de testar no Chrome, Safari, Opera, Firefox, DuckDuckGo e Edge. Funciona exatamente como você descreveu que deveria.
O DIV inferior e o script de animação só são carregados quando o usuário rola a página até o ponto em que normalmente estariam visíveis. Nesse momento, o Event Listener do JavaScript é acionado, o que faz com que o DIV surja gradualmente (fade in) e se mova para cima.