});
test("trigger(type, [data], [fn])", function() {
- expect(11);
+ expect(12);
var handler = function(event, a, b, c) {
equals( event.type, "click", "check passed data" );
pass = false;
}
ok( pass, "Trigger focus on hidden element" );
+
+ pass = true;
+ try {
+ jQuery('table:first').bind('test:test', function(){}).trigger('test:test');
+ } catch (e) {
+ pass = false;
+ }
+ ok( pass, "Trigger on a table with a colon in the even type, see #3533" );
});
test("trigger(eventObject, [data], [fn])", function() {
jQuery('span#liveSpan1').die('click');
});
+test("live with focus/blur", function(){
+ expect(2);
+
+ // Setup
+ jQuery("<input type='text' id='livefb' />").appendTo("body");
+
+ var $child = jQuery("#livefb"),
+ child = $child[0],
+ counter = 0;
+
+ function count(){
+ counter++;
+ }
+
+ // Test
+ $child.live("focus", count);
+ $child.live("blur", count);
+
+ child.focus();
+ equals(counter, 1, "Test live() with focus event");
+ window.scrollTo(0,0);
+
+ child.blur();
+ equals(counter, 2, "Test live() with blur event");
+
+ // Teardown
+ $child.die("focus", count);
+ $child.die("blur", count);
+ $child.remove();
+});
+
test("Non DOM element events", function() {
expect(3);