tags:

views:

35

answers:

4

hi,

is anybody familiar with greyBox JavaScript plugin? orangoo.com/labs/GreyBox/

it's for slideshows and stuff.. I can't get it to work in FF/Safari; it works great in IE, but FF/Safari won't play ball..

orensanz.org/photos.html

would very much appreciate some suggestions.. supposedly there's a google group (forum) for this thing (can't post url.. this thing limits how many urls u can include in a post, it's linked to from their home pg (url above.. oh brother..) but when you link to it you land on a pg that says they've been booted out b/c they violated google's terms of service....;-)

thank you..

A: 

It looks to me as if there's a race condition in some of that Javascript code. If the image isn't in cache, then this looks to me like it'll never make the image box visible:

 if(gb_type == "image") {
   if(img_holder.width != 0 && img_holder.height != 0) {
     var width = img_holder.width;
     var height = img_holder.height;

     GB.width = width;
     GB.height = height;

     setupOuterGB();

     if(GB.use_fx) {
       AJS.setOpacity(frame, 0);
       AJS.fx.fadeIn(frame);
     }
   }
 }
 else {
   GB.width = frame.offsetWidth;
   GB.height = frame.offsetHeight;
   setupOuterGB();
 }

In think that code should be called as the "load" handler for the image. Note that your page works fine in Firefox the second time you click on any particular image.

Pointy
thank you to both responders.. all the JS for this thing is minified.. but anyway, I'm searching, can't find the code quoted in your responses anywhere.. can't find, for exampleif(gb_type == "image") {or "gb_type" or even "GB."searching in these three files:greybox/AJS.jsgreybox/AJS_fx.jsgreybox/gb_scripts.jsthis is all the JS code for this plugin..thank you very much..
kali
oh man.. DISREGARD MY PREVIOUS VERY STUPID COMMENT!!I just realized first respondent's code was NEW code for me to include.. it works now!! thank you so much..!! :-)(it's still a bit slow going in FF, I need to hit buttons again and again, till it works, but am hoping it's a cache issue or something (also: had to put the code in html, didn't work if I put it in separate .js file..) thank you..
kali
kali
A: 
    if(GB.show_loading) {
 AJS.AEV(window, 'load', function(e) {
 loaded();
 });
}
else {
 loaded();
} 

Try putting these lines on either a timeout or replace the lower loaded() with AJS.AEV(window, 'load', function(e) {loaded();});

Aaron Harun
I have it working in FF now but only locally, online it still doesn't work.. (have now added setTimeout too...)
kali
Try increasing the timeout to something large like 10 seconds, so you can see for sure if that is helping or not.You can always use another "lightbox" script since you are just displaying images.
Aaron Harun
A: 

I did the latter.. www.orensanz.org/photos.html

js is here.. www.orensanz.org/js/of.js

(I have now cached all images...)

thank you..

kali
A: 

(I couldn't add comment, nothing happens when click on 'add comment'..)

yes I know I can use other lightboxes.. but what I do need is one in which slideshow lands in photo the user CLICKED.. at work I've been using this one, flowplayer.org/tools/demos/scrollable/easing.html, but when you tell it to start at a given photo (not photo 1) it SLIDES towards it.. I need one in which it just lands on specified photo without the sliding effect -- other than that this one would be perfect

a lot of slick JS lightboxes out there have 'next' button on top of photo itself and other stuff obstructing photo a bit, I don't want that.. ) oh man, I still can't get this thing to work AT ALL in Safari, whereas examples they have online (orangoo.com/labs/GreyBox/) work fine in Safari, I don't get this.. thank you for your help (btw: I tried many diff settings for setTimeout, all the way from 1000 milliseconds to about 30,000.. either way Safari won't touch it.. :-(

kali