jquery define own events? -
is possible define event on input fired upon these circumstances.
a) called on blur of input if remaining conditions true b) if autocomplete list visible halt event until closed c) if autocomplete list closes without item being selected event fired d) if autocomplete list closes item being selected event not fired e) if reason blur caused because item in autocomplete clicked event not fired
as can see event has quite bit it. cant use normal settimeout in blur event because user sitting on the autocomplete list without selecting anything.
maybe set variable on autocomplete open know still open.
if timer expires , autocomplete still open can reset timer.
on close can unset variable.
or on select of item can unset timer?
what think?
it's possible trigger own events using trigger function. means can call event @ separate points in code, don't have write complicated constructions.
simply call this: $('.yourclass').trigger('myevent');
linking event can done through .bind()
, ie. $('.yourclass').bind('myevent', function () { });
Comments
Post a Comment