标签:
1. example:
<!DOCTYPE HTML>
<html>
<head></head>
<body>
<div id="chan">click me again!!</div>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(function(){
$("#chan").toggle(function(event){
$(event.target).css(‘color‘,‘red‘);
},function(event){
$(event.target).css(‘color‘,‘blue‘);
});
});
</script>
</body>
</html>
2.每当触发click事件就相互切换
jquery toggle(listenerOdd, listenerEven)
标签:
原文地址:http://www.cnblogs.com/rocky-fang/p/5208963.html