繁体   English   中英

在这里使用show方法显示弹出窗口popUpDiv是一个div

[英]to display popup using show method here popUpDiv is a div

谁能建议JavaScript中show()的替代方法,该方法在ie11中支持[在此处输入图像描述] [1],因为显示/隐藏不支持它。

 function displayPopUp(xPopUp,yPopUp,wPopUp,lPopUp,message) { showDivCache(); var oPopup=document.getElementById("popUpDiv"); oPopup.style.backgroundColor = "#D6D6D6"; oPopup.style.border = "solid black 3px"; oPopup.innerHTML = "<TABLE width='100%' height='100%'><TR valign='middle'><TD align='center'><B>"+message+"</B></TD></TR></TABLE>"; **oPopup.show(popUpX, popUpY, popUpW, popUpL, document.body);** window.onfocus = redisplayPopUp; var size=0; var tabAllData=document.all; if (tabAllData.document!=null) size=document.all.length; for (i = 0;i<size;i++) { fldObj = tabAllData[i]; fldObj.onfocus=redisplayPopUp; } return true; 

我不记得IE11的问题。 如何使用jquery通过多种方式实现这一目标。

$('#id').toggle()

$('#id').fadeIn()  
$('#id').fadeOut()  

使用css

.hidden{
display: none;}

$('#id').addClass("hidden");

甚至

 document.getElementById("id").style.visibility = "hidden"; 

 //this one will remove the allocated space 
 document.getElementById("id").style.display = "none"; 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM