How to catch complex events?(Hurry!)

S

sleepinglord

An example: I have a select input. I wanna catch those onclick events
which is not a onchange events. How to implement it?

And in general, there's some basic kinds of events, and I wanna catch
the events which is a composition of the basic events. How to?

Where can I find some examples£¿
 
R

Randy Webb

sleepinglord said the following on 5/7/2006 9:58 PM:
An example: I have a select input. I wanna catch those onclick events
which is not a onchange events. How to implement it?

What is the event you want to catch?
And in general, there's some basic kinds of events, and I wanna catch
the events which is a composition of the basic events. How to?

What composition of events? You basically catch one and then catch
another, but the second is dependent on the first.
Where can I find some examples£¿

Examples of what?
 
R

RobG

sleepinglord said:
An example: I have a select input. I wanna catch those onclick events
which is not a onchange events. How to implement it?

And in general, there's some basic kinds of events, and I wanna catch
the events which is a composition of the basic events. How to?

Where can I find some examples£¿

You should probably start with the Mozilla Gecko DOM reference - it has
examples and links to the relevant parts of the specification:

<URL:http://developer.mozilla.org/en/docs/DOM:element#Event_Handlers>


You could also look at quirksmode for some differences between the IE
and W3C event models (there are several pages):

<URL:http://www.quirksmode.org/js/introevents.html>
 
S

sleepinglord

What is the event you want to catch?
I wanna catch the event which is an onclick event but not an onchange
event.

What composition of events? You basically catch one and then catch
another, but the second is dependent on the first.

Suppose there're 3 kinds of event, onA, onB, onC;
For example, I wanna do something when onA and onB happen, but onC not.
Such a situation is what I called events composition. It's just like s
logical operation on those events.
And In general. How to implement such operations?
 
R

Randy Webb

sleepinglord said the following on 5/8/2006 4:48 AM:

Your quoting style leaves some to be desired.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

<URL: http://www.safalra.com/special/googlegroupsreply/ >

I wanna catch the event which is an onclick event but not an onchange
event.

You can't with a select list. You can catch it in Mozilla and Opera by
adding an onclick to the Option but IE doesn't support onclick of the
Option or Select.
Suppose there're 3 kinds of event, onA, onB, onC;
For example, I wanna do something when onA and onB happen, but onC not.
Such a situation is what I called events composition. It's just like s
logical operation on those events.

onchange="var myChange=true;alert('onchange fired')"
onclick="if (!myChange){alert('Click without change'}
else{alert('Click with Change')"

That would be the basic idea. You set a variable for each event handler
and check that variable in other events.
 
S

sleepinglord

Thanks a lot!
Randy Webb 写é“:
sleepinglord said the following on 5/8/2006 4:48 AM:

Your quoting style leaves some to be desired.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

<URL: http://www.safalra.com/special/googlegroupsreply/ >



You can't with a select list. You can catch it in Mozilla and Opera by
adding an onclick to the Option but IE doesn't support onclick of the
Option or Select.


onchange="var myChange=true;alert('onchange fired')"
onclick="if (!myChange){alert('Click without change'}
else{alert('Click with Change')"

That would be the basic idea. You set a variable for each event handler
and check that variable in other events.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top