+ 8
Dissapearing images
How can I make images disappear after a few seconds coding please
7 Réponses
+ 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. 😊
+ 10
Put this on CSS file:
img {
animation-name: transperancychange;
animation-duration: 5s;
}
@keyframes transperancychange {
from { opacity: 1.0; }
to { opacity: 0.0; }
}
+ 4
@Maz I think css animation still not fully compatible to all browsers yet.
+ 2
js:
setInterval(function() {
yourImageElement.style.visibility = "hidden":
}, 4)
+ 2
@Calvin Lee F*** IE
+ 2
@Maz I just changed opacity to cross browser, hopefully this time can work on your phone. ☺