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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.