How do i make a specific image on code.org, which is in javascript, blink, Im making a simple game where you click a ball and it moves around the screen, but i also want to make it blink so the ball disappears and comes back again, I know you can do it with texts but I have a button, that is an image and cant seen to figure it out.
            Asked
            
        
        
            Active
            
        
            Viewed 1,136 times
        
    -1
            
            
        - 
                    3http://stackoverflow.com/questions/16291863/how-to-make-an-icon-flash-blink-which-is-present-in-a-web-page – Sabin Dec 07 '16 at 21:00
- 
                    Have you done anything? any code? – EhsanT Dec 07 '16 at 21:20
- 
                    Yes, this is the code for the basketball and when its clicked onEvent("basketball", "click", function(event) { console.log("court clicked!"); setPosition("basketball", randomNumber(50,280), randomNumber(50, 350)); setText("total_score", score + 1); score = score + 1; if (score == 20) { setScreen("winScreen"); } }); – Tj Brawn Dec 07 '16 at 21:26
- 
                    And what are `onEvent`, `setPosition`, `setText` and `setScreen`? Please edit your post and add all the code you have to it – EhsanT Dec 07 '16 at 21:47
1 Answers
0
            
            
        Nowadays you probably would use CSS animations for running simple animations like blink effects and use Javascript to initiate the animation. Something like what's mentioned here should do the trick: Imitating a blink tag with CSS3 animations
Just toggle the class to start/stop the animation.
 
    
    
        Community
        
- 1
- 1
 
    
    
        whispernocturn
        
- 116
- 5
