Jump to content

problem hiding div tag


siri

Recommended Posts

I am not able to hide the div tag . This problem occurs in IE. I have used a png file as a background for my div tag.Here is the code snippet:******************************************<script type = "text/javascript">var ie = document.all ? true : false;var flag = true;function init(){if(!ie){document.getElementById("overlay").style.backgroundImage = "url(bg1.png)";}else{document.getElementById("overlay").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='bg1.png', sizingMethod='scale')";}}function show(item){document.getElementById(item).style.visibility="visible";document.getElementById("cboState").disabled = true;flag = false;document.getElementById(item + "_btn").focus();}function hide(item){document.getElementById(item).style.visibility="hidden";document.getElementById("cboState").enabled = true;flag = true;}<body bgcolor="#C2E6F6" onkeypress="return status()" onload="init()"><div id="overlay" class="overlay"><div style="border:inset 3px aqua">Review Your Employment Information<br /><input type="button" value="OK" onclick ="hide('overlay')" /></div></div>

Link to comment
Share on other sites

Instead of these:document.getElementById(item).style.visibility="visible";document.getElementById(item).style.visibility="hidden";Use the display property instead:document.getElementById(item).style.display="block";document.getElementById(item).style.display="none";

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...