Colorbox breaks into rel attribute when loading bxslider

After much debugging, I came to the conclusion that the two libraries collide. I tested them both separately and they work, but when they are used together (and the attribute attribute breaks)

How to play

  • If the link has rel or $ ('something'). colorbox ({rel: 'something'});
  • $ ('somethingelse') bxSlider (...) ;.

colorbox will fail when you click on any image that has colorbox (and not just general options)

Uncaught TypeError: Cannot read the 'rel' property from undefined

Code line violation:

      if (settings.rel !== 'nofollow') {
          $related = $('.' + boxElement).filter(function () {
              var relRelated = $.data(this, colorbox).rel || this.rel;
              return (relRelated === settings.rel);
          });

jQuery noconflict, ? . . -, , , bxSlider $.data(), colorbox.

, :

  • ?
  • colorbox?
  • bxSlider?
+5
2

, , , , , , colorbox bxslider, , . , - .

+1

, , . $('something').colorbox({rel:'something'}); , , , id rel. colorbox rel (rel: 'something') . . http://www.jacklmoore.com/colorbox

, . jsbin, .

: http://jsbin.com/ovucuz/11/edit#javascript,html,live

0

All Articles