fix for #4234. hover can take one function to use for both enter and leave.
This commit is contained in:
parent
3a9c827bf8
commit
8f042d8be3
2 changed files with 19 additions and 1 deletions
|
@ -233,6 +233,24 @@ test("unbind(eventObject)", function() {
|
|||
assert( 0 );
|
||||
});
|
||||
|
||||
test("hover()", function() {
|
||||
var times = 0,
|
||||
handler1 = function( event ) { ++times; },
|
||||
handler2 = function( event ) { ++times; };
|
||||
|
||||
jQuery("#firstp")
|
||||
.hover(handler1, handler2)
|
||||
.mouseenter().mouseleave()
|
||||
.unbind("mouseenter", handler1)
|
||||
.unbind("mouseleave", handler2)
|
||||
.hover(handler1)
|
||||
.mouseenter().mouseleave()
|
||||
.unbind("mouseenter mouseleave", handler1)
|
||||
.mouseenter().mouseleave();
|
||||
|
||||
equals( times, 4, "hover handlers fired" );
|
||||
});
|
||||
|
||||
test("trigger() shortcuts", function() {
|
||||
expect(6);
|
||||
jQuery('<li><a href="#">Change location</a></li>').prependTo('#firstUL').find('a').bind('click', function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue