首页 > 代码库 > Jquery版文字闪烁

Jquery版文字闪烁

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.w3school.com.cn/jquery/jquery.js"></script>
<style type="text/css">
.changecolor1{color:red;}
.changecolor2{color:blue;}
</style>
</head>

<body>
<script type="text/javascript">

	function ChangeColor(){
		$("#color1").toggleClass("changecolor1");
		$("#color2").toggleClass("changecolor2");
		setTimeout("ChangeColor()",1000)
	}
	ChangeColor();
</script>
<a href="http://www.mamicode.com/#" style="color:green;"><p id="color1">color1</p></a>
<p id="color2">color2</p>
</body>
</html>

  

Jquery版文字闪烁