Nightloewe
Neues Mitglied
Bei dem Code soll er das usermenu zeigen sobald man auf den a link klickt, aber das geht irgendwie nicht.
Stylesheet:
Code:
<?php
session_start();
?>
<html>
<head>
<title>Start | Craft Network</title>
<script type="Text/Javascript">
function openusermenu() {
if(document.getElementById('Logindiv').style.display=='block')
{document.getElementById('Logindiv').style.display='none';}
else
{document.getElementById('Logindiv').style.display='block';}}
</script>
</head>
<Body>
<script type="Text/Javascript">
function openusermenu() {
if(document.getElementByClass('Logindiv').style.display=='block')
{document.getElementById('Logindiv').style.display='none';}
else
{document.getElementById('Logindiv').style.display='block';}}
</script>
<div id="menu">
<div id="menuli">
<ul>
<li id="menu1" onclick="window.location.href = 'index.php';" style="background-Color: #151515;"><a href="index.php"><b>Start</b></a></li>
<li id="menu2" onclick="window.location.href = 'index.php?page=ueber';"><a href="index.php?page=ueber"><b>Über uns</b></a></li>
<li id="menu3" onclick="window.location.href = 'index.php?page=spiele';"><a href="index.php?page=spiele"><b>Spiele</b></a></li>
<li id="menu4" onclick="window.location.href = 'index.php?page=regeln';"><a href="index.php?page=regeln"><b>Regeln</b></a></li>
<li id="menu5" onclick="window.location.href = 'index.php?page=vote';"><a href="index.php?page=vote"><b>Vote</b></a></li>
<li id="menu6" onclick="window.location.href = 'forum/';"><a href="forum/"><b>Forum</b></a></li>
<?php
session_start ();
?>
<!-- if (!isset ($_SESSION["username"])) -->
'<li id="menu7"><a href="JavaScript: openusermenu();"><b>Benutzer</b></a></li>
<!-- }
else
{
echo '<li id="menu9" onclick="window.location.href = 'index.php?page=ucp';"><a href="index.php?page=ucp"><b>Benutzerbereich</b></a></li>';
echo '<li id="menu10"><a href="logout.php"><b>Logout</b></a>';
}
?> -->
</ul>
<div id="Logindiv">
<div class="Dreieck"></div>
<ul id="Login">
<li id="notenabledtext">
<?php
if (!isset ($_SESSION["username"]))
{
echo "Eingeloggt";
}
else
{
echo "Nicht eingeloggt";
}
?>
</li>
Code:
#Logindiv {
Display:none;
Position: absolute;
left: 612px;
}
.Dreieck {
position: absolute;
left: 45px;
width:0px;
height:0px;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 20px solid white;
}
ul#Login {
Position: absolute;
background-Color: White;
border-radius: 3px;
border: 1px solid #D8D8D8;
z-index: 1;
top: -8px;
}
ul#Login li {
z-index: 2;
}
li#notenabledtext {
Color: #BDBDBD;
}