fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

Can't set overlay opacity to 0

Open sbenes opened this issue 14 years ago • 3 comments

I don't know if it is just me but I wanted to set the opacity of the overlay to 0 and couldn't. At line 1218 the code does a check to see if someone set the opacity or uses the default. This check doesn't allow a zero as my example code below show's that you can run.

var test1 = {
  opacity: 0
};

var test2 = {
  opacity: 0.01
};

var test3 = {
  foobar: 0
};

console.log(test1.opacity || "I can't set zero");
console.log(test2.opacity || "I never wanted zero and you shouldn't see this text");
console.log(test3.opacity || "I never had it to begin with, so you should see this");

sbenes avatar Dec 21 '11 20:12 sbenes

Fixed in the last commit

fancyapps avatar Dec 28 '11 14:12 fancyapps

Opacity of overlay do not working properly in version 2.1 http://jsfiddle.net/Kw6UH/

$(".fancybox").fancybox({
    helpers : {
        overlay : {
            opacity : 0,
            css : {
                'background' : 'rgba(58, 42, 45, 0.95)',
            }
        }
    }
});​

in version 2.0.5 everything works fine http://jsfiddle.net/Vx92b/2/ .

Could you tell me, please, is it still possible to set opacity in new versions of funcyBox and how?

Thank you for attention and this amazing image viewer :)

coderaiser avatar Sep 25 '12 10:09 coderaiser

I understand, just write things like this. And opacity flag is just do not using anymore. http://jsfiddle.net/Kw6UH/2/

$(".fancybox").fancybox({
    helpers : {
        overlay : {
            css : {
                'background' : 'rgba(58, 42, 45, 0.1)',
            }
        }
    }
});​

coderaiser avatar Sep 26 '12 08:09 coderaiser