我正在尝试在页面上使用简单的模态jquery库,并且模式弹出窗口隐藏在我页面上的嵌入式youtube对象后面。我试着搞乱z-index,但无法解决这个问题。有什么建议吗?
答案 0 :(得分:2)
要防止Flash对象“渗透”对话框,请确保为对象设置wmode属性,并将元素嵌入到opaque或transparent(reference)。
答案 1 :(得分:1)
function hideFlash() {
var embeds = document.getElementsByTagName('embed');
for (i = 0; i < embeds.length; i++) {
embeds[i].style.visibility = 'hidden';
}
var objects = document.getElementsByTagName('object');
for (i = 0; i < objects.length; i++) {
objects[i].style.visibility = 'hidden';
}
var iframes = document.getElementsByTagName('iframe');
for (i = 0; i < iframes.length; i++) {
iframes[i].style.visibility = 'hidden';
}
};
function showFlash() {
var embeds = document.getElementsByTagName('embed');
for (i = 0; i < embeds.length; i++) {
embeds[i].style.visibility = 'visible';
}
var objects = document.getElementsByTagName('object');
for (i = 0; i < objects.length; i++) {
objects[i].style.visibility = 'visible';
}
var iframes = document.getElementsByTagName('iframe');
for (i = 0; i < iframes.length; i++) {
iframes[i].style.visibility = 'visible';
}
};