target is the target of the event. So if the user clicked a link, the link
is the target.
note that if you attach an event to monitor clicks to say, a div, and the
user clicks a link inside the div, the target is the link, not the div.

On Thu, Jan 8, 2009 at 12:34 PM, jiggliemon (via Nabble) <
ml-user+114393-900309...@n2.nabble.com<ml-user%2b114393-900309...@n2.nabble.com>
> wrote:

>
> Thanks Nutron,
> I saw the .target in the docs, but i thought that was referring to the
> element which was going to be changed... like target="" does in the
> HTML.  And after i tested using .target(), and it didn't work, i
> thought it best to come here.... but, target is not a function.
>
> Thanks for your help.
>
> On Jan 8, 9:01 am, nutron 
> <anut...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2129953&i=0>>
> wrote:
> > element.addEvent('blur', this.configureElement.bindWithEvent(this,
> element);
> > ...
> > configureElement: function(event, element) {
> >         alert('the id is' + element.get('id'));
> >
> > }
> >
> > On Wed, Jan 7, 2009 at 11:28 PM, jiggliemon (via Nabble) <
> > ml-user+114393-900309...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2129953&i=1>
> <ml-user%2b114393-900309...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2129953&i=2>>
>
> >
> >
> >
> > > wrote:
> >
> > > "you could also use bindWithEvent and pass the element as a parameter.
> > > "
> >
> > > How would this work?
> >
> > > --------- example? -------
> > > initialize: function() {
> > >         $$(elements).each(function(element){
> > >                 element.addEvent('blur',
> > > this.configureElement.bindWithEvent(this));
> > >         });
> > > },
> > > configureElement: function(element){
> > >         alert('the id is' + element.get('id'));
> > > }
> >
> > > On Jan 7, 11:23 pm, nutron <anut...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=0>>
> > > wrote:
> >
> > > > you could also use bindWithEvent and pass the element as a parameter.
>
> >
> > > > On Wed, Jan 7, 2009 at 11:22 PM, Aaron Newton <aa...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=1>>
> > > wrote:
> > > > > event.target
> >
> > > > > On Wed, Jan 7, 2009 at 11:12 PM, jiggliemon (via Nabble) <
> > > > > ml-user+114393-900309...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=2>
> > > <ml-user%2b114393-900309...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=3>>
> >
> > > > > > wrote:
> >
> > > > >> I'm porting a Magento template over to Mootools, and i've run into
> a
> > > > >> little issue.
> >
> > > > >> Prototype has a ".element()" function where you can select the
> element
> >
> > > > >> that an event is attached to.
> >
> > > > >> --------- example -------
> > > > >> initialize: function() {
> > > > >>         $$(elements).each(function(element){
> > > > >>                 element.addEvent('blur', this.config.bind(this));
> > > > >>         });
> > > > >> },
> > > > >> config:function(event){
> > > > >>         //Here's your Prototype function
> > > > >>         var element = event.element();
> > > > >>         this.configureElement(element);
> > > > >> },
> > > > >> configureElement: function(element){
> > > > >>         alert('the id is' + element.get('id'));
> > > > >> }
> >
> > > > >> So my question is, how do i select the element of which an event
> is
> > > > >> bound to in mootools?
> >
> > > > >> ------------------------------
> > > > >>  View message @
> > > > >>
> http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-...
> >
> > > > >> To start a new topic under MooTools Users, email
> > > > >> ml-node+660466-1583815...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=4>
> > > <ml-node%2b660466-1583815...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2126733&i=5>>
> >
> > > > >> To unsubscribe from MooTools Users, click here< (link removed) >.
> >
> > > > -----
> > > > The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> > > > Clientcide:  http://www.clientcide.comwww.clientcide.com
> > > > --
> > > > View this message in context:
> > >http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-...
>
> > > > Sent from the MooTools Users mailing list archive at Nabble.com.
> >
> > > ------------------------------
> > >  View message @
> > >http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-...
>
> > > To start a new topic under MooTools Users, email
> > > ml-node+660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2129953&i=3>
> <ml-node%2b660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2129953&i=4>>
>
> > > To unsubscribe from MooTools Users, click here< (link removed) >.
> >
> > -----
> > The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> > Clientcide:  http://www.clientcide.comwww.clientcide.com
> > --
> > View this message in context:
> http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-...
> > Sent from the MooTools Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>  View message @
> http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-tp2126710p2129953.html
> To start a new topic under MooTools Users, email
> ml-node+660466-1583815...@n2.nabble.com<ml-node%2b660466-1583815...@n2.nabble.com>
> To unsubscribe from MooTools Users, click here< (link removed) >.
>
>
>


-----
The MooTools Tutorial:  http://www.mootorial.com www.mootorial.com 
Clientcide:  http://www.clientcide.com www.clientcide.com 
-- 
View this message in context: 
http://n2.nabble.com/Porting-Magento-over-to-Mootools-from-Prototype-tp2126710p2130032.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to