简体   繁体   中英

to display popup using show method here popUpDiv is a div

can anyone suggest an alternative method for show() in JavaScript that supports in ie11 s[enter image description here][1]ince show/hide not supporting it...

 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; 

I don't remember problems with IE11. How ever you can acheive this by many ways with jquery.

$('#id').toggle()

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

Using css

.hidden{
display: none;}

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

Or even

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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