Ich bin mal so frei und kopiere ein wenig JS Code von mir:
Code:
var var_add_comment_visible;
var var_show_comment_visible;
var_add_comment_visible = 0;
var_show_comment_visible = 0;
function add_comment()
{
if(var_add_comment_visible == 0)
{
var_add_comment_visible = 1;
document.add_comment.style.display = "block";
}
else
{
document.add_comment.style.display = "none";
var_add_comment_visible = 0;
}
}
function show_comment()
{
if(var_show_comment_visible == 0)
{
var_show_comment_visible = 1;
document.show_comment.style.display = "block";
}
else
{
document.show_comment.style.display = "none";
var_show_comment_visible = 0;
}
}
Die Funktionen hab ich immer über nen Link aufgerufen.
Code:
<a href="javascript :add_comment()">Kommentar hinzufügen</a> ::: <a href="javascript :show_comment()">Kommentare anzeigen</a>
Das Script läuft eigentlich einwandfrei hab noch keine Beschwerden gehört, deswegen hoffe ich mal, das es euch hilft