jackmoore / colorbox

A light-weight, customizable lightbox plugin for jQuery
http://www.jacklmoore.com/colorbox/
MIT License
4.75k stars 1.14k forks source link

Colorbox no more working after inclusion of jquery-1.11.2.min.js #862

Closed hqueyra closed 6 years ago

hqueyra commented 6 years ago

I'm not an expert in JavaScript, I'm using ColorBox for a while, with no pb, and for a new feature, I had to include jquery-1.11.2.min.js and since then, I'm getting this error jquery.js:16 Uncaught TypeError: $(...).colorbox is not a function on the code $("a[rel='zoom']").colorbox({

I'm really struggling to understand why including a recent version of jquery could make my colorbox object no more defined...

Tx for your help...

Globulopolis commented 6 years ago

@hqueyra check if jquery loaded.

hqueyra commented 6 years ago

Yes it is ! When JQuery 1.5.1 is loaded everything is fine, if I load 1.11.2 I'm getting this error...

jackmoore commented 6 years ago

@hqueyra I imagine you are accidentally loading jQuery twice. The first inclusion of jQuery is probably the one you extended with Colorbox, and somewhere along the way jQuery was included an additional time taking over the previous jQuery and $ variables. Since the 2nd instance of jQuery hasn't been extended with the Colorbox plugin, you get the error that $(...).colorbox is not a function.

hqueyra commented 6 years ago

You are exactly right, when I load the recent version with colorbox extended, it's working ! Tx you