Ok, I'm developing a site (currently at stmatts.essentialtech.co.nz) which uses the admin menu module for administrative tasks andalso uses quite a bit of random JS... when I enable the ColorBox module it breaks things and the admin menu disappears, and the ticker JS for the 7-day view breaks (and probably all the rest of the JS on the page by the looks of things).

I'm not sure where to start looking to see what is causing this - and I know that if I enable Javascript compression in the performance page the site breaks in a similar way - so its possible that its not (at least not ALL) ColorBox's fault. I will try disabling a few other modules (like thickbox) later on and see if I can find something else that could be the root of the problem.

Steve

Comments

jdwfly’s picture

Sorry to hear that, I'm using the current cvs version and it seems to work just fine. Try these things though.

1. Make sure you have set the colorbox js and css in the admin/settings/colorbox
2. It is dependent on jquery_update 2.x version because it needs jquery 1.3, but that also means it will break views, and some other stuff. If you look around there are fixes for that though. I'll post them if I can find them again.

kiwi_steve’s picture

Version: » 6.x-1.x-dev

I'm going to shift the testing from the dev site I'm working on to another one, because the dev site is close to going live and I can't risk breaking it now :) Hopefully in a few days I'll have some time to play with this some more...

Steve

afterdark’s picture

Subscribing, whenever things start to grow again. Colorbox seems to be THE engine to handle image fireworks. Expecting anxiously.

kiwi_steve’s picture

Ok, I've just done a clean 6.14 install using the 'Sky' theme. Installed the usual modules, including admin_menu and also colorbox to test it... and it broke again.

steps: jquery_update enabled, still working, colorbox enabled, all the javascript on the site turns to custard. It looks like its not until colorbox gets enabled that things actually break. I'll look into it a little closer and see if there is something obvious, but just thought I would let you know I am still keen, and still looking at it.

Steve

jdwfly’s picture

What is the javascript error? If you using firefox and the web developer toolbar it will tell you what the error is.

kiwi_steve’s picture

According to Firebugs console (Haven't used the web developer toolbar for a while now, firebug seems to cover most of what I need)

Cheers

Steve

$(".colorbox").colorbox is not a function
anonymous(Document %3Cfront%3E)colorbox.js?t (line 3)
anonymous()drupal.js?t (line 42)
anonymous(Object, function(), Object name=args)jquery.js?t (line 741)
anonymous(Document %3Cfront%3E)drupal.js?t (line 41)
anonymous()drupal.js?t (line 277)
anonymous()jquery.js?t (line 2294)
anonymous()jquery.js?t (line 2314)
anonymous([function(), function()], function(), Object name=args)jquery.js?t (line 745)
anonymous()jquery.js?t (line 2313)
[Break on this error] $('.colorbox').colorbox();\r\n
jdwfly’s picture

You need to set the path to colorbox.js under Site Configuration.

I need to make it so that it doesn't try to add the js file when the variable is empty.

kiwi_steve’s picture

it is set, tho? Is this right? (And can this be auto-configured since its included in the module?):

sites/all/modules/colorbox/colorbox.js

And the CSS file (non-existent), I just made an empty CSS file just in case (linux: touch colorbox.css) and pointed the configuration at it.

Steve


I think I found the problem... colorbox.js included in the CVS is not the required one, right? :) I've downloaded the colorbox zip from their site... I'll play some more and get back to you.

Steve

jdwfly’s picture

is the colorbox.js code actually between the script tags or is it a drupal 404 page?

kiwi_steve’s picture

Hmmm... thought putting the jquery.colorbox.js in might have fixed the problem. Seems to have added more problems... Ok, here is what I have:

(Have a look at - this is the dev site I am playing with at the moment if you want to see what is happening)

colorbox.js (file from CVS)
colorbox.info (from CVS)
colorbox.js (from CVS)
colorbox.module (from CVS
jquery.colorbox.js (from colorpowered.com)
colorbox.css (from examples 1 folder in zip from colorpowered.com)
/images (folder from examples 1 folder as with CSS file above)

Path to colorbox .js file:
sites/all/modules/colorbox/jquery.colorbox.js

Path to colorbox .css file:
sites/all/modules/colorbox/colorbox.css

JS Errors from console now:

$.support is undefined
anonymous(function())jquery.c...rbox.js?J (line 12)
jquery.colorbox.js?J()jquery.c...rbox.js?J (line 698)
isIE = !$.support.opacity, \r \n jquery.c...rbox.js?J (line 12)

$(".colorbox").colorbox is not a function
anonymous(Document colorbox)colorbox.js?J (line 3)
anonymous()drupal.js?J (line 42)
anonymous(Object, function(), Object name=args)jquery.js?J (line 741)
anonymous(Document colorbox)drupal.js?J (line 41)
anonymous()drupal.js?J (line 277)
anonymous()jquery.js?J (line 2294)
anonymous()jquery.js?J (line 2314)
anonymous([function(), function()], function(), Object name=args)jquery.js?J (line 745)
anonymous()jquery.js?J (line 2313)
$('.colorbox').colorbox(); \r \n colorbox.js?J (line 3)

jdwfly’s picture

Colorbox requires jquery 1.3 which means you have to use the 6.x-2.x-dev version of jQuery Update. If you do that, your errors should go away.

kiwi_steve’s picture

Great! It works... finally...sort of :)

...not as expected. If I click the original image or thumbnail links under an image in an image node, they pop up in a colorbox window... but if I click an attached image in a node it doesn't. Is this right? Fundamentally, I would want to be able to have colorbox support for images attached to nodes.

Cheers for your help with this

Steve

jdwfly’s picture

Category: bug » support
Status: Active » Fixed

Haven't got that far yet for the module. If you want a certain feature please open a new issue so we can keep track of it there. I'm marking this as fixed this since you got it working

kiwi_steve’s picture

Sweet as, many thanks :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

capoyeti’s picture

Hiya Steve,

When you say you got it working - was this because you updated (or loaded) jquery_update? Or did you do something else to get it to work?

I'm struggling with a similar issue - clicking on images renders them in the parent browser window as a standalone image.

tx,
Chad

dilari’s picture

mhhh same here, the config says you should point to the plugin directory, right ? not the file ?

"Enter the path relative to Drupal root where the Colorbox plugin directory is located."