The only problem I see with this is if the user is tabbing through a
document/form. The mouse could be anywhere, but the user is still
manually focussing/blurring.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Apr 8, 2009, at 2:31 AM, Jordon Bedwell wrote:
Use the mouse to detect said events would sound logical to me. On
the focus
trigger, have the script check if the mouse is in the "area" of the
object
and if it is assume that it was user triggered and continue,
othewise assume
it was a method of the application.
-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com]
On
Behalf Of Klaus Hartl
Sent: Tuesday, April 07, 2009 11:09 PM
To: jQuery (English)
Subject: [jQuery] Re: How to tell apart focus event
In the past I distinguished between true and triggered events via the
e.clientX property (a triggered event has no such property). Not sure
if it's the same with focus events (especially since you're calling
elem.focus and there is no elem.click) and if there is a better way...
--Klaus
On 6 Apr., 04:24, bob <xoxeo...@gmail.com> wrote:
Hi,
<form>
Name: <input type="text" id="my_name" name="my_name">
</form>
Is it possible to tell apart focus event?
jQuery("#my_name").focus(function (evt) {
if( ??? ){
//execute this if focus was triggered by user
clicking on
the text
field
}
else {
//execute this if focus was triggered by method
call like
this
//document.getElementById("my_name").focus();
}
});