equals( mouseoverCounter, 1, "bind() with multiple events at once" );
});
+test("bind(), multiple events at once and namespaces", function() {
+ expect(7);
+
+ var cur, obj = {};
+
+ var div = jQuery("<div/>").bind("focusin.a", function(e) {
+ equals( e.type, cur, "Verify right single event was fired." );
+ });
+
+ cur = "focusin";
+ div.trigger("focusin.a");
+
+ div = jQuery("<div/>").bind("click mouseover", obj, function(e) {
+ equals( e.type, cur, "Verify right multi event was fired." );
+ equals( e.data, obj, "Make sure the data came in correctly." );
+ });
+
+ cur = "click";
+ div.trigger("click");
+
+ cur = "mouseover";
+ div.trigger("mouseover");
+
+ div = jQuery("<div/>").bind("focusin.a focusout.b", function(e) {
+ equals( e.type, cur, "Verify right multi event was fired." );
+ });
+
+ cur = "focusin";
+ div.trigger("focusin.a");
+
+ cur = "focusout";
+ div.trigger("focusout.b");
+});
+
test("bind(), no data", function() {
expect(1);
var handler = function(event) {
});
test("trigger(type, [data], [fn])", function() {
- expect(12);
+ expect(14);
var handler = function(event, a, b, c) {
equals( event.type, "click", "check passed data" );
pass = false;
}
ok( pass, "Trigger on a table with a colon in the even type, see #3533" );
+
+ var form = jQuery("<form action=''></form>").appendTo("body");
+
+ // Make sure it can be prevented locally
+ form.submit(function(){
+ ok( true, "Local bind still works." );
+ return false;
+ });
+
+ // Trigger 1
+ form.trigger("submit");
+
+ form.unbind("submit");
+
+ jQuery(document).submit(function(){
+ ok( true, "Make sure bubble works up to document." );
+ return false;
+ });
+
+ // Trigger 1
+ form.trigger("submit");
+
+ jQuery(document).unbind("submit");
+
+ form.remove();
+});
+
+test("jQuery.Event.currentTarget", function(){
});
test("trigger(eventObject, [data], [fn])", function() {