Page 1 of 1

using “jQuery.event.special”

Posted: Sat Apr 25, 2015 9:40 am
by gautamz07
I have been try to look up the bootstrap transition.js (line 50) code and figure out how it works in there . i have stumbled across a really big hurdle . the line of code thats got me stumped is the following :

Code: Select all

    $.event.special.bsTransitionEnd = {
          bindType: $.support.transition.end,
          delegateType: $.support.transition.end,
          handle: function (e) {
            if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
          }
now i did read the documentation https://learn.jquery.com/events/event-extensions/. but really could't understand much except the following :

bindType: // the event you want to bind with
delegateType: // the event you want to delegate with

I tried to ask a few JS coders but the only answer i got was

> Those are the special attributes for the transition end event that
> are made available for later use in transition.js.
But I SILL DON'T GET IT .

I am trying to figure out things by reading this http://benalman.com/news/2010/03/jquery-special-events/ article , but all i want to know is .... what is `$.event.special` , WHAT is the use of this line ? WHAT is its common usage ? if any of u guys have used this in any of ur projects or coded this kind of stuff it would be great if you can share your knowledge with me .

Thank you.

Gautam.

[1]: https://github.com/twbs/bootstrap/blob/ ... ion.js#L50
[2]: https://learn.jquery.com/events/event-extensions/
[3]: http://benalman.com/news/2010/03/jquery-special-events/
[4]: http://stackoverflow.com/questions/8919 ... tom-events

Re: using “jQuery.event.special”

Posted: Sat Apr 25, 2015 4:32 pm
by Christopher
You say your are stumped, but don't say what your question about this code it. It binds a function to a transition end event. What is your question?

Re: using “jQuery.event.special”

Posted: Sun Apr 26, 2015 10:00 am
by gautamz07
My question is i don't know what $.event.special.bsTransitionEnd is used for ?? what senario would u use such code in ? i don't know its basic use case !

Re: using “jQuery.event.special”

Posted: Sun Apr 26, 2015 12:20 pm
by gautamz07
My question actually is , what is the most fundamental use of $.event.special.

Re: using “jQuery.event.special”

Posted: Sun Apr 26, 2015 1:02 pm
by Christopher