+ 1
How to make an element flashes in html js
help me doing that and upvote me please
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
+ 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 ;)
+ 1
upvote this question please
0
nice idea
0
but maybe there is sth ready to do flash