Created
July 4, 2010 22:48
-
-
Save badsyntax/463826 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// delegate a list item mouseenter event to a list | |
function mouseenter( event ){ | |
$( event.target ).addClass( 'mouseenter' ); | |
} | |
$('ul').delegate( 'li', 'mouseenter', mouseenter ); | |
// trigger the first list items delegated event | |
$('ul').find('li:first').each(function(){ | |
mouseenter.apply( this.parentNode, [ { target: this } ]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment