+ 8

Dissapearing images

How can I make images disappear after a few seconds​ coding please

22nd Apr 2017, 2:40 PM
Iwan
Iwan - avatar
7 Answers
+ 13
Hi @Calvin, your code doesn't work in my phone. 😕 @Bebida, set the time to "5000", your function will actived after only 4 millisecond. An alternative way is Javascript, you can use a simple function like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <img src = "yourimage.extension" id = 'img1'> <script> var img = document.getElementById('img1'); setInterval(function () { img.style.display="none"; }, 5000) </script> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (1000 = 1 second / 10000 = 10 seconds) Bye. 😊
22nd Apr 2017, 3:21 PM
Maz
Maz - avatar
+ 10
Put this on CSS file: img { animation-name: transperancychange; animation-duration: 5s; } @keyframes transperancychange { from { opacity: 1.0; } to { opacity: 0.0; } }
22nd Apr 2017, 2:55 PM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar
+ 4
@Maz I think css animation still not fully compatible to all browsers yet.
22nd Apr 2017, 3:23 PM
Calviղ
Calviղ - avatar
+ 2
js: setInterval(function() { yourImageElement.style.visibility = "hidden": }, 4)
22nd Apr 2017, 2:54 PM
Bebida Roja
Bebida Roja - avatar
22nd Apr 2017, 3:02 PM
Calviղ
Calviղ - avatar
+ 2
@Calvin Lee F*** IE
22nd Apr 2017, 3:26 PM
Bebida Roja
Bebida Roja - avatar
+ 2
@Maz I just changed opacity to cross browser, hopefully this time can work on your phone. ☺
22nd Apr 2017, 3:35 PM
Calviղ
Calviղ - avatar