P
P
PoodingRex2017-04-09 12:45:28
JavaScript
PoodingRex, 2017-04-09 12:45:28

How to animate JS element replacement?

Hello. Can you please tell me how to animate the text replacement that occurs when clicking on the image? Those. it looks like this: https://jsfiddle.net/2oyw2yw2/ but the text in the block appears very quickly. How can it be slowed down? Thanks in advance for your reply.

<span id="review-text">тут текст</span> 

<img src="/image.png" alt="текст, который проявляется при клике на картинку" onclick="document.getElementById('review-text').innerHTML = this.alt">

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2017-04-10
@PoodingRex

For multiple images:
https://jsfiddle.net/Stalk/z8no232w/

O
Oleg, 2017-04-09
@politon

Alternatively https://jsfiddle.net/Politonius/d05d48sp/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question