+ 1

How to make an element flashes in html js

help me doing that and upvote me please

22nd Dec 2016, 7:56 AM
Hussam Aldarwish
Hussam Aldarwish - avatar
5 Answers
+ 2
Simply: Do hidding it, wait a little, do showing it, wait a little, and restart... But you need improve the code for not getting all your pc ressources only for flashing on element :P
22nd Dec 2016, 8:14 AM
visph
visph - avatar
+ 2
With css there is a kind of, but unfortunaly it's rarely implemented in modern browsers... ( flashing was an old possibility on text-screen, from the age of monochromic monitors ) So, I didn't evocate it because your question was about html AND js ^^ Two tricks, if you want to implement the hide-show solution: * In css, you have 2 possibilities to display or not an element, the display and the visibility properties ( well, a third with the opacity property, but it's not adapted for full show-hide ). - The "display:none;" would retrieve the element from the pageflow, so the siblings ones are moving to use the released space. - The "visibility:hidden;" would hidde the element, but continue to reserve space so the others ones don't be moving. * For waiting, dont make a big loop, you will lose all ressources, prefer the window.setTimeOut() method, or the window.setInterval() one ;)
22nd Dec 2016, 8:25 AM
visph
visph - avatar
+ 1
upvote this question please
24th Dec 2016, 2:30 AM
Hussam Aldarwish
Hussam Aldarwish - avatar
0
nice idea
22nd Dec 2016, 8:14 AM
Hussam Aldarwish
Hussam Aldarwish - avatar
0
but maybe there is sth ready to do flash
22nd Dec 2016, 8:15 AM
Hussam Aldarwish
Hussam Aldarwish - avatar