将Transperancy设置为iFrame Inside Modal弹出菜单 [英] Setting Transperancy To iFrame Inside Modal Popup
问题描述
我在后台显示一个pdf,并在顶部包含一个iFrame我想要设置透明度的弹出窗口。
它在Chrome浏览器和浏览器的其余部分不工作完美工作:(这里是Fiddler链接:点击这里
请告诉我在所有浏览器中应该怎么做。
有了一个小的javascript和CSS这应该没有biggie,虽然iframe会需要包含在div中,或者某些事情:
< div id =iframeContainer>
< iframe src =http://example.com>< / iframe>
< / div>
然后在您的javascript:
//设置div的css透明度NOT iframe:
iframeContainer.style.opacity = 0.5; //越接近1越透明
iframeContainer.style.MozOpacity = 0.5; //越接近1越不透明
iframeContainer.style.filters.alpha.opacity = 50; //越接近100越不透明
I am showing a pdf in the background and a Popup over the top which contains an iFrame I want to set the transparency to the popup. It works perfectly in Chrome browser and the rest of the browser it doesn't work :( Here is the Fiddler Link : Click Here
Please Tell Me What should i do to work in all the browsers.
解决方案With a little javascript and CSS this should be no biggie, though the iframe will need to be wrapped in a div, or something of the matter:
<div id="iframeContainer"> <iframe src="http://example.com"></iframe> </div>
Then in your javascript:
// Set the css opacity of the div NOT the iframe: iframeContainer.style.opacity = 0.5; // the closer to 1 the less transparent iframeContainer.style.MozOpacity=0.5; // the closer to 1 the less transparent iframeContainer.style.filters.alpha.opacity=50; // the closer to 100 the less transparent
这篇关于将Transperancy设置为iFrame Inside Modal弹出菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!