9279

Fork this way...

by rwaldron

HTML

<div id="test_box">
<a href="#" class="test1">Test 1</a><br><br>
<a href="#" class="test2">Test 2</a>
</div>

JavaScript

var $test = $("#test_box"), 
    tests = [
        [ "mouseenter", "mouseleave" ],
        [ "mouseover", "mouseout" ]
    ];

$.each( tests, function( idx, events ) {
    $test.delegate("a.test" + (idx+1), events.join(" "), function( event ) {
        console.log("fired:", event.type);
    });
});