标签:function custom ext 学习 use var class html click
//trigger $(‘#foo‘).on(‘click‘, function() { alert($(this).text()); }); $(‘#foo‘).trigger(‘click‘); $(‘#foo‘).on(‘custom‘, function(event, param1, param2) { alert(param1 + "\n" + param2); }); $(‘#foo‘).trigger(‘custom‘, [‘Custom‘, ‘Event‘]);
var data = { id: 5, name: "张三" }; var events = { "mouseenter": function(event){ $(this).html( "你好," + event.data.name + "!"); }, "mouseleave": function(event){ $(this).html( "再见!"); } }; //为n5绑定mouseenter mouseleave两个事件,并为其传入附加数据data $("body").on(events, "#n5", data);
标签:function custom ext 学习 use var class html click
原文地址:http://www.cnblogs.com/heyinwangchuan/p/6239520.html