using “jQuery.event.special”

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

using “jQuery.event.special”

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: using “jQuery.event.special”

Post 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?
(#10850)
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: using “jQuery.event.special”

Post 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 !
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: using “jQuery.event.special”

Post by gautamz07 »

My question actually is , what is the most fundamental use of $.event.special.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: using “jQuery.event.special”

Post by Christopher »

(#10850)
Post Reply