On Dec 8, 2008, at 7:47 PM, Wade Preston Shearer wrote:

Can anyone explain to me why this:

function banana() {
        alert('banana function called');
}

$('tr').hover(
        function() {
                banana();
        },
        function() {
                banana();
        }
);


…works, but this…


Because that's the way the jQuery hover() function works:

        http://docs.jquery.com/Events/hover#overout



function banana() {
        alert('banana function called');
}

$('tr').hover(banana(), banana());


…does not?


Because hover() takes Functions as arguments, and what you are doing is calling the functions when setting up the hover event.


--
Joseph Scott
[EMAIL PROTECTED]
http://josephscott.org/






_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to