Jump to content

help with div show and hide


MDanz

Recommended Posts

i want the div to start off hidden.  I know how to make it show and hide.  The problem is when i load the page the border is seen. If i use display:none; in the div css the div doesn't display even when i press the button with the function to show.

 

open and close function

function infobox(number) {
document.getElementById('userinfo').style.display = "block"; //displays userinfo
  
}

function closeinfo() {
document.getElementById('userinfo').style.display = "none";

}

 

div css

#userinfo {
position:absolute;
text-align:left;
width:900px;
height:auto;
top:100px;
left:50%;
font-size:14px; 
font-family:Arial;
z-index:20;
margin-left:-450px;
background-color:#FFFFFF;
border:1px solid #264971;

}

Link to comment
https://forums.phpfreaks.com/topic/238144-help-with-div-show-and-hide/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.