Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with Floating Social Bar Plugin in WordPress #750

Closed
frank6tg opened this issue Sep 14, 2015 · 1 comment
Closed

Conflict with Floating Social Bar Plugin in WordPress #750

frank6tg opened this issue Sep 14, 2015 · 1 comment

Comments

@frank6tg
Copy link

When sites using "Simple Colorbox" plugin also use "Floating Social Bar" (FSB) Plugin the colorbox "picks up" an extra image which forces an error message.

You can view this behavior on any blog post of mine: Example: http://franksdesigns.com/custom-return-address-stamps/

YOu'll see 3 images, the Colorbox reports 4 images, loads the second image first (the first REAL image) If you go back to the first image you get a blank item with this error: "This image failed to load."

@jackmoore
Copy link
Owner

Colorbox is doing exactly what it was told to do. You need to change how you assign Colorbox so that it only selects the elements you want it to.
And you have 4 links on that page that end in '.jpg'. This is the first one:

<a href="http://pinterest.com/pin/create/button/?url=http://franksdesigns.com/custom-return-address-stamps/&description=Custom+Return+Address+Stamps&media=http://franksdesigns.com/wp-content/uploads/SKK-Return-Address-Stamp.jpg" class="socialite pinit fsb-pinterest" data-fsb-service="pinterest" target="_blank" rel="nofollow"><span class="fsb-service-title">Pinterest</span><span class="fsb-count">0</span></a>

This is how your page currently assigns Colorbox:

jQuery(function($){ 
            // Examples of how to assign the ColorBox event to elements 
            $("a[href$=\'jpg\'],a[href$=\'jpeg\'],a[href$=\'png\'],a[href$=\'bmp\'],a[href$=\'gif\'],a[href$=\'JPG\'],a[href$=\'JPEG\'],a[href$=\'PNG\'],a[href$=\'BMP\'],a[href$=\'GIF\']").colorbox(colorboxSettings); 
        });;

You will want make this more restrictive and specific to your site, so that it only selects the images you are interested in showing in the lightbox. For this page, you could do something like this instead:

jQuery(function($){
    $('.gallery-icon a').colorbox(colorboxSettings);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants