首页 > 代码库 > unsilder中的jq深入学习

unsilder中的jq深入学习

//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 = http://www.mamicode.com/{ 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);

unsilder中的jq深入学习