PDA

View Full Version : Lightbox 2.05 combined with conveyor belt slideshow problem



dabsy86
07-21-2011, 10:19 AM
I am using the conveyor belt slideshow combined with Lightbox 2.05, setup as a multiple picture slideshow. Everything is working fine apart from when the Lightbox slideshow opens it triples the pictures shown.

For example if I have a 3 picture gallery slideshow, Lightbox will say Image 1 of 9 instead of Image 1 of 3. It will display the 3 pictures in the gallery and then repeat them a further 2 times.

Does anyone have any suggestions or solutions to this problem?

Any help would be gratefully appreciated. Im ripping my hair out.

Thanks
Craig

jscheuer1
07-22-2011, 07:18 AM
I'd use SlimBox2:

http://www.digitalia.be/software/slimbox2

And replace its init with:


// Live invocation for use with other scripts, image maps, AJAX, etc. - also skips duplicates when forming groups
// Uses the rev attribute of the tag for a caption, freeing up the title for other uses or to be blank.
// Remove the AUTOLOAD CODE BLOCK if using this, or replace it with this code.
// Live Load Script (c)2011 John Davenport Scheuer - for use with Slimbox 2.04
// as first seen in http://www.dynamicdrive.com/forums/
// username: jscheuer1 - This Notice Must Remain for Legal Use
(function($){
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
$('*[href][rel^=lightbox]').live('click', function(e){
var t = this, rel = t.getAttribute('rel'), hrefs = [], links = [], index;
if(rel === 'lightbox'){
$.slimbox(t.href, t.getAttribute('rev') || '', { /* Options */ });
} else {
$('*[href][rel="' + rel + '"]').each(function(){
if($.inArray(this.href, hrefs) < 0){
if(t.href === this.href){index = hrefs.length;}
hrefs.push(this.href);
links.push([this.href, this.getAttribute('rev') || '']);
}
});
$.slimbox(links, index, {loop: true /* , Aditional Options */ });
}
e.preventDefault();
});
}
})(jQuery);

If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

dabsy86
07-22-2011, 09:48 AM
Thanks for your reply. I will give that a go.

Update - I have tried using Slimbox and with your change of code and everything works spot on. One minor snag is that the gallery keeps looping even when it is set to false. Not a major issue which i'm sure we can live with.

Thanks again for your help.

jscheuer1
07-22-2011, 12:58 PM
I didn't have that problem. Can you give us a link to the page?

But we might not need that. After changing:


$.slimbox(links, index, {loop: true /* , Aditional Options */ });

to:


$.slimbox(links, index, {loop: false /* , Aditional Options */ });

and be sure not to quote the word false, otherwise it evaluates to true, make sure to clear the browser's cache and refresh the page.

If you're still having that problem and want help. Post a link to the live page.

dabsy86
07-22-2011, 01:11 PM
That has done the trick thanks for your help. Works perfectly now.

I didn't spot the loop function in the change of code you provided. Thanks for pointing that out.