Thank you for the advice. It worked perfectly.
On Jun 1, 6:28 am, "Brandon Aaron" <[EMAIL PROTECTED]> wrote:
> If you actually create a function reference instead of passing an anonymous
> function, they will not be duplicated.
>
> var fn = function(e) { alert('in textfield'); };
>
> $('input.te
If you actually create a function reference instead of passing an anonymous
function, they will not be duplicated.
var fn = function(e) { alert('in textfield'); };
$('input.text').bind('focus', fn);
In the near future, once jQuery 1.1.3 is released, you would be able to use
the behavior plugin
I think the fool-proof way would be to do something like adding a
class, for example:
$("input.text:not(.focused)").focus(function(){ ... }).addClass("focused");
That way you can run that line as many times as you want and it'll
never re-bind the focus event.
--John
On 5/31/07, John R <[EMAIL
3 matches
Mail list logo