How to Change Lightbox Background Colour
Su2z
Registered Users Posts: 25 Big grins
Hi,
We are using a light theme, Dina, and would like to have a transparent dark background colour only in lightbox pages. Is there a way to do this?
We are using a light theme, Dina, and would like to have a transparent dark background colour only in lightbox pages. Is there a way to do this?
0
Comments
I usually use this CSS to change the background color of the lightbox :
.sm-user-ui .sm-lightbox{
background-color: #000000 !important;
opacity: .75;
}
You can adjust the numbers accordingly.
Try it jerryr
SmugMug Sites - Creative Examples
Favorite Images and SmugMug Designs
22, 22, 22, is the RGB color
.40 is the transparency .10 (lighter) to .90 (darker)
background: rgba(22, 22, 22, .40);
My Website index | My Blog
Thank you, jerryr and Allen
My background is a pale yellow, yet several components remain grey. Arrows drawn:
- left and right arrows
- bottom caption bar
- The X to get out
Thanks! In all the many customization codes for lightbox that I've seen, I could not figure out these pieces.
Usually only photos are protected but not all the page elements.
My Website index | My Blog
Is this a comment to me, Allen? I'm not understanding then, because most customized sites I've viewed do have these extra elements matching their background. Sherlock has a very dark grey... Denise has a pale tan against her soft white background. You have a black/dark grey background and your captions are also dark grey, but with transparency.
These code bits have to be available to code dunces like me.
Never seen that on any other site.
Edit: actually now R/C does not even work anywhere in lightbox.
My Website index | My Blog
This is just on my site that R/C doesn't work?
Very confused... have no idea what's wrong or how to fix it... crycry
This is what I have on my site:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
I didn't understand the "root" part of your code... since I have lots of customized galleries where one gallery's lightbox and its small other associated parts need to be separately coded, I tried this code in one gallery:
But there was no change to the default (pale yellow with grey other bits).
I would appreciate knowing what to do differently.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
HOLY MOLEY it worked! GO FIGURE. I was certain "root" must have something to do with being in site-wide css only.
WOW. Okay, now I have to figure out how to control each one of these babies separately, for color and transparency. You grouped them together and applied one color to all. Can I add this part of the code to each code, as in:
Of course. In my case I wanted them all the same color.
EDIT: Make sure you remove the commas:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
What appears to have happened is that the code is "taking" in the custom galleries too (those ought to have defaulted to the original site-wide default? (which would have been grey for the little bits)).
Maybe this is what "root" caused? In which case I need to test whether this code will let me change the colors in a custom gallery that now seems to be controlled by the code in "all galleries".
A later project... but not too much later.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Thanks, Mike! lust I went ahead and moved the code to the site-wide CSS... sure wish I could tell if I now have conflicting code anywhere else, but, in random photo views in different galleries, including some that are the default site format, and some that are "this gallery only", the color scheme seems reasonable. One example:
http://www.joinrats.com/Beautiful/i-cGVzTdK/A
The code I ended up with:
In case it matters, this is the only other lightbox code in my CSS:
And these don't seem to work:
Would you know how I can change the arrows (left/right nav), and the "X" in the top right corner, to change the color and size?
I use this to change the color.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
SmugMug Support Hero
Or, change the lightbox background in site-wide CSS. This is what I have (hopefully it's the best code for the purpose):
Thanks, Mike, I tried this. Got the colors working well, but the size seems to control all the elements, arrows, X for out, and the icons for Share/Settings/Download, etc. I think I need to separate them for size control.
I face the same problem, the photo becomes transparent too. I tried this recommendation of yours but it didn't work for me. Do you have a complete CSS for this?
{
...
opacity: 1;
}
My Website index | My Blog
and here's an example of what it looks like:
http://www.sarasphotos.de/Recent-Additions/i-rbnzhg6/A
Hope this helps someone!
Cheers, Sara
background-color: transparent; !important;
background-color: transparent !important;
My Website index | My Blog
Cheers, Sara
My Website index | My Blog
Can someone please help me with my Lightbox CSS code.
In a nut shell, I have it setup so that the image appears and fills the browser vertically, and then the Viewer can scroll down to see the Title / Caption / keywords etc.
I want a dark background for the image but can't get it to work. I have found the code the prevents it from working but don't understand why.
You'll see that the first phrase if included in the CSS prevents it from working, where as if I remove it, the background color works, but the image is full height (included in the scroll area, and the title/caption/keywords cannot be seen.
Your help would be greatly appreciated. (Ignore the ugle #ff00ff value, it is for readily recognizing whether it worked. )
All other code in my CSS is working including the rest of the lightbox arrow behavior.
To find this in CSS – search Sherlock
/* THIS First PHRASE breaks background color for lightbox */
body.sm-page-node.sm-noscroll .sm-lightbox {
position: static;
}
/* set background color DOESN”T WORK and auto height */
.sm-user-ui .sm-lightbox {
height: auto !important;
width: auto !important;
background-color: #FF00FF !important;
}
TIA,
Guy
gschlact
schlacter.smugmug.com
http://schlacter.smugmug.com