1

I have a client that is wanting to have jquery.colorbox and wants the background of that colorbox to be transparent, but text in the colorbox to not be. Also the colorbox is loading an iframe it is not inline. I could possibly make it inline, but I'd rather not if I can help it. Any help would be greatly appreciated.

I looked up online that in order to use it in an iframe I need 'allowtransparency="true" as one of the attributes and then style="background-color:transparent" in the body, but I don't know how to do this using colorbox. Is there a way to add attributes to a colorbox iframe?

Ian Overton
  • 1,060
  • 7
  • 17

2 Answers2

1

how about using the css setting.

<style>
div#target
{
background-color:rgba(255,255,255,0.3);
}
</style>
AhHao Liow
  • 11
  • 1
  • I'm not wanting to know the css solution my problem is more the colorbox. I don't know how to tell colorbox what it needs to do to the iframe in order to allow transparency. – Ian Overton Mar 02 '12 at 22:31
0

Using the iframe essentially load a separate piece of html markup into the iframe. You can assign any styles rules you need to that markup, but I suspect you'll have problems with transparency.

This isn't a Colorbox issue, it's more an issue with IE's shaky support for transparency.

This Stackoverflow questions may help you grok the issue: Transparent Iframe Body

All the best,

KJM

Community
  • 1
  • 1
CSSian
  • 1,621
  • 13
  • 19
  • as I posted in my original question it isn't an issue of how to do it to an iframe, but more an issue of how to do it to an iframe created by colorbox. – Ian Overton Mar 08 '12 at 14:40
  • Colorbox doesn't impose any specific style rules on an iframe, other than overall height and width dimensions. If you can achieve the effect you're after on a standalone HTML page, then if will very likely work using ColorBox. If it doesn't, you'll want to look for ColorBox CSS rules that take precedence over the iframe's, but I've never seen that happen. – CSSian Mar 08 '12 at 20:58