Search code examples
jqueryhtmlcssfancybox

Change the background color of Fancybox


I want to make the background color of Fancybox transparent.

The obvious way is to use ".fancybox-skin" in your CSS, but this will affect all fancyboxes, and I need it to vary. Thus the setting needs to be sent with wrapCSS.

Fancybox has a parameter "wrapCSS" that can be passed in with the original js call, but I'm not sure how to use it. It just says "string": http://fancyapps.com/fancybox/#useful

I've been trying to pass in the CSS like {wrapCSS: "background: red"}, but it's not working.


Solution

  • Use wrapCSS to add a class, then in your CSS:

    .whateverYouChooseforWrapCSS .fancybox-skin {
      background: none;
    }