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

Opacity of overlay doesn't change after re-invoke. #121

Closed
legaev-stas opened this issue Oct 11, 2011 · 4 comments
Closed

Opacity of overlay doesn't change after re-invoke. #121

legaev-stas opened this issue Oct 11, 2011 · 4 comments

Comments

@legaev-stas
Copy link

If colorbox is opened and user try to open new one with new "opacity" for overlay, it won't change.
Example:
jQuery.colorbox({opacity:0.3})
jQuery.colorbox({opacity:0.8})
console.log(jQuery('#cboxOverlay').css('opacity')) // 0.3

Thanks.

@jackmoore
Copy link
Owner

How is that an issue? It's a setting. If you want to change it on
the fly, use CSS.

On Tue, Oct 11, 2011 at 9:40 AM, legaev-stas
[email protected]
wrote:

If colorbox is opened and user try to open new one with new "opacity" for overlay, it won't change.
Example:
jQuery.colorbox({opacity:0.3})
jQuery.colorbox({opacity:0.8})
console.log(jQuery('#cboxOverlay').css('opacity'))    //  0.3

Thanks.

Reply to this email directly or view it on GitHub:
#121

Jack Moore
colorpowered.com
twitter.com/jacklmoore

@legaev-stas
Copy link
Author

This is not a proble to change it by CSS.
But when I invoked colorbox with one content and after that(without closing) I invoked it again with another content and with another "opacity", it wasn't changed. This is wierd behavior.
Don't you think?

@jackmoore
Copy link
Owner

You can easily change it via CSS.

$('#cboxOverlay').css('opacity', 1);

In addition, $.colorbox({..settings..}) doesn't do anything because
it's not associated with anything. If you want to change a setting on
an element you've assigned colorbox to, you need to reassign colorbox
with the new setting value:

// change the default setting:
$.colorbox.settings.opacity = 0.8;

// update it on an element:
$('#example').colorbox({opacity:0.5});
$('#example').colorbox({opacity:0.3});

On Tue, Oct 11, 2011 at 11:05 AM, legaev-stas
[email protected]
wrote:

This is not a proble to change it by CSS.
But when I invoked colorbox with one content and after that(without closing) I invoked it again with another content and with another "opacity", it wasn't changed. This is wierd behavior.
Don't you think?

Reply to this email directly or view it on GitHub:
#121 (comment)

Jack Moore
colorpowered.com
twitter.com/jacklmoore

@jackmoore
Copy link
Owner

I'm sorry. Coming back and reading this again and it makes better sense to me (I think). You still can't change settings on the fly by calling colorbox a new settings object, but my guess is that you weren't actually doing this:

$.colorbox({opacity:0.5});
$.colorbox({opacity:0.3});

But probably something like this:

$.colorbox({opacity:0.5, html:'hello'});
$.colorbox({opacity:0.3, html:'howdy'});

And the opacity wouldn't have changed, like you pointed out. Fixed now, and sorry about the misunderstanding.

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