Add jQuery mouseenter event and fix text() method

This commit is contained in:
Boris Yankov
2012-11-20 15:35:26 +02:00
parent 2b805340b5
commit 1f7209edce
2 changed files with 22 additions and 1 deletions
+4 -1
View File
@@ -514,6 +514,9 @@ interface JQuery {
mouseevent(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
mouseevent(handler: (eventObject: JQueryEventObject) => any): JQuery;
mouseenter(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
mouseenter(handler: (eventObject: JQueryEventObject) => any): JQuery;
mouseleave(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
mouseleave(handler: (eventObject: JQueryEventObject) => any): JQuery;
@@ -610,7 +613,7 @@ interface JQuery {
replaceWith(func: any): JQuery;
text(): string;
text(textString: string): JQuery;
text(textString: any): JQuery;
text(textString: (index: number, text: string) => string): JQuery;
toArray(): any[];
+18
View File
@@ -1119,6 +1119,24 @@ function test_each() {
});
}
function test_mouseEvents() {
var i = 0;
$("div.overout").mouseover(function () {
$("p:first", this).text("mouse over");
$("p:last", this).text(++i);
}).mouseout(function () {
$("p:first", this).text("mouse out");
});
var n = 0;
$("div.enterleave").mouseenter(function () {
$("p:first", this).text("mouse enter");
$("p:last", this).text(++n);
}).mouseleave(function () {
$("p:first", this).text("mouse leave");
});
}
function test_prop() {
var $input = $(this);
$("p").html(".attr('checked'): <b>" + $input.attr('checked') + "</b><br>"