rstacruz / jquery.transit

Super-smooth CSS3 transformations and transitions for jQuery
http://ricostacruz.com/jquery.transit
7.29k stars 862 forks source link

$.support collision with bootstrap #67

Open jgrund opened 12 years ago

jgrund commented 12 years ago

I am using bootstrap and jquery.transit together on a project.

There is a naming collision in the way $.support.transition is used by both libraries.

Where transit does this:

  support.transition      = getVendorPropertyName('transition');
  support.transitionDelay = getVendorPropertyName('transitionDelay');
  support.transform       = getVendorPropertyName('transform');
  support.transformOrigin = getVendorPropertyName('transformOrigin');
  support.transform3d     = checkTransform3dSupport();

  $.extend($.support, support);

Bootstrap does this:

 $.support.transition = (function () {

      var transitionEnd = (function () {

        var el = document.createElement('bootstrap')
          , transEndEventNames = {
               'WebkitTransition' : 'webkitTransitionEnd'
            ,  'MozTransition'    : 'transitionend'
            ,  'OTransition'      : 'oTransitionEnd otransitionend'
            ,  'transition'       : 'transitionend'
            }
          , name

        for (name in transEndEventNames){
          if (el.style[name] !== undefined) {
            return transEndEventNames[name]
          }
        }

      }())

      return transitionEnd && {
        end: transitionEnd
      }

    })()

As you can see, transit sets support.transition to a string while Bootstrap assigns an object literal. This is causing bootstrap modal to not work correctly when it searches for the $.support.transition.end property.

clemenshelm commented 12 years ago

+1 for this issue!

AmyGail commented 12 years ago

+2! If anyone has a workaround/patch. I'd be grateful if you'd share.

rstacruz commented 11 years ago

The fix is to remove this line, actually:

  $.extend($.support, support);
rstacruz commented 11 years ago

Bootstrap doesn't seem to be respecting jQuery conventions. jQuery's documentation (here) seems to suggest that $.support.xxx should be set to a string of the vendor-prefixed version of xxx, which Transit does, but Bootstrap doesn't.

In any case, let me fix this.

rstacruz commented 11 years ago

Test it out in v0.9.9, guys.

blakeperdue commented 10 years ago

This is still an issue with v0.9.9 and Bootstrap v3.1.1

furioursus commented 10 years ago

I can confirm that this is still not working with Bootstrap 3.1.1 and Transit 0.9.9

rstacruz commented 10 years ago

Can anyone check out #143 and see if it fixes your problem?

rstacruz commented 10 years ago

...that is, see if @isochronous's fork here works for you. As I don't have a bootstrap project easily-accessible right now to try it on, perhaps any of you kind folks can help me test it :)

furioursus commented 10 years ago

Yup, that fork resolves the issue. Thanks!

On Fri, Apr 25, 2014 at 9:33 PM, Rico Sta. Cruz notifications@github.comwrote:

...that is, see if @isochronous https://github.com/isochronous's fork herehttps://raw.githubusercontent.com/isochronous/jquery.transit/955551641d64066766313223d9b91f6ccdc531d6/jquery.transit.jsworks for you. As I don't have a bootstrap project easily-accessible right now to try it on, perhaps any of you kind folks can help me test it :)

— Reply to this email directly or view it on GitHubhttps://github.com/rstacruz/jquery.transit/issues/67#issuecomment-41459658 .

Christopher Kennedy Web Designer, ExpressionEngine & Craft CMS Developer

Part-time Haberdasher, full-time Crazy Cat Lady

{one:bright:light} about.me/christopherkennedy

Google Voice: (415) 226-9663 Twitter: @onebrightlight

rstacruz commented 10 years ago

Thanks! Will review it in a while and merge it in.