jquery自定义事件要用到2个方法

公司主营业务:成都网站建设、做网站、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。成都创新互联是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。成都创新互联推出湘阴免费做网站回馈大家。
1:bind(type,[data],fn);其中type是自定义事件类型(名称);data是可选参数,是自定义函数fn中第一个参数中的data属性,注意data是一个数组类型;fn是事件触发时执行的函数。
2:trigger(type,[data]);其中type是自定义事件类型(名称);data是可选参数是自定义函数fn中第二个参数,注意这是一个数组类型。
应用举例:
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Document</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta name="keywords" content="">
<meta name="description" itemprop="description" content="">
<meta name="protocol" content="1">
<meta itemprop="name" content="name">
<meta itemprop="p_w_picpath" content="/upload/otherpica42/213636.jpg"/>
<link rel="DNS-prefetch" href="http://7.url.cn">
<link rel="dns-prefetch" href="http://9.url.cn">
<link rel="dns-prefetch" href="http://8.url.cn">
<link rel="stylesheet" href="http://8.url.cn/edu/css/common.980ee.css"/>
<link rel="stylesheet" href="http://8.url.cn/edu/css/index_refactor.90164.css"/>
<link rel="shortcut icon" href="http://9.url.cn/edu/img/favicon.ico"/>
</head>
<body>
<div>
<p>
<input type="text" id="number01" value="0"> +
</p>
<p>
<input type="text" id="number02" value="1">
<input type="button" id="ok" value="=">
</p>
<p>
<input type="text" id="result" value="1">
</p>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
<!--
$(window).bind("resultChange",function(event,a,b,c){
alert(a+":"+b+":"+c);
});
$("#result").change(function(){
var result=$(this).val();
if(result>0)
$(window).trigger("resultChange",[result,result,result]);
});
$("#ok").click(function(){
$("#result").val(($("#number01").val()-0)+($("#number02").val()-0));
$("#result").change();
});
//-->
</script>
</body>
</html>