[jQuery] How to call a function directly that is normally an event.. ?
Sorry, I don't know how to summarize this problem so I'll just post
code.
Let's say you have this:
$('#myID').click(magicFunc);
magicFunc looks like:
function magicFunc()
{
$(this).fadeOut();
}
Now, let's say I want to invoke magicFunc on a certain item MANUALLY,
via code, not through a user-driven event. e.g.: (I know this is
wrong)
$('#myID').magicFunc();
I don't want to make a plug-in. I just want to somehow make the $
(this) reference in magicFunc() refer to whatever I pass into it. Is
that possible?