Jump to content
php.lv forumi

toggle_visibility


ziedinjsh

Recommended Posts

 
  function toggle_visibility(id) {
      var e = document.getElementById(id);
      if(e.style.display == 'none')
         e.style.display = 'block';
      else
         e.style.display = 'none';
   }

tagad atverot lapu DIV ir vaļā.. uzspiežot uz linka tad viņš aizveras.. vajag lai atverot lapu DIV ir ciet!

 

kas jādar?

Link to comment
Share on other sites

Tas jādara ar CSS.

 

echo "<div id='report'>";
echo "<div class='title'><a href='#' onclick='toggle_visibility(".$data['id'].");'>".$data['title']."</a></div>";
echo "<div class='date'>".$data['date']."</div>";
echo "<div class='fix'></div>";
echo "<div id='".$data['id']."' class='message'>".$data['message']."</div>";
echo "<div class='remail'>".$data['email']."</div>";
echo "<div class='delete'><a href='delete.php?del_report=".$data['id']."'>Delete</a></div>";
echo "<div class='fix'></div>";
echo "</div>";

 

#report{
border:1px solid #161B1F;
padding:5px;
margin-bottom:5px;
}
#report .title{
font-size:20px;
width:500px;
float:left;
font-weight:bold;
font-family:arial;
}
#report .date{
border-left:1px solid #161B1F;
padding-left:5px;
font-size:12px;
float:right;
}
#report .message{
font-size:16px;
border-top:2px solid #161B1F;
padding:5px;
}
#report .remail{
border-top:1px solid #161B1F;
float:left;
}
#report .delete{
border-top:1px solid #161B1F;
float:right;
}
#report .delete a{
text-decoration:none;
color:#ff0000;
cursor:pointer;
}

 

kā lai to izdara ar css?

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...