Changing font colors after certain time duration - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:css

Description

Changing font colors after certain time duration

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*from  w w  w.  j  a v a2 s  .co  m*/
$('#v1').hover(function() {
   $(this).css('color','#777');
}, function() {
setTimeout(function() {
    $('#v1').css('color','#000');
},2000);});
    });

      </script> 
 </head> 
 <body> 
  <a id="v1">Hello</a>  
 </body>
</html>

Related Tutorials