Commit ee1fc6f6 authored by Ryan Wade's avatar Ryan Wade

Nav Bar Update to allow dropdown menus. need to restyle css to original blue theme.

parent 43eb3679
......@@ -3,7 +3,6 @@
}
#breadcrumbBox
{
position: relative;
padding: 7px 15px;
width: 100%;
......
/*NavBar*/
nav
{
/**width:1050px;
margin:10px 0px;
height:40px;
background:rgba(86, 170, 204, 0.75);
border:1px solid black;
border-radius: 5px;
-webkit-border-radius: 5px;
-webkit-border-radius: 5px;**/
}
#NavBar
{
width:1050px;
margin:10px 0px;
height:40px;
/**Top Level Nav**/
nav ul ul {
display: none;
}
#NavBar ul
{
text-align:right;
margin:0px;
padding:0px 50px;
nav ul li:hover > ul {
display: block;
}
nav ul {
background:rgba(86, 170, 204, 0);
box-shadow: 0px 0px 9px rgba(0,0,0,0.15);
padding: 0 20px;
border-radius: 10px;
list-style: none;
position: relative;
display: inline-table;
}
nav ul:after {
content: ""; clear: both; display: block;
}
nav ul li {
float: left;
}
#NavBar ul li
nav ul li:hover {
background: #4b545f;
background: linear-gradient(top, #4f5964 0%, #5f6975 40%);
background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%);
background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%);
}
nav ul li:hover a {
color: #fff;
}
nav ul li a {
display: block; padding: 25px 40px;
color: #757575; text-decoration: none;
}
/**Submenu**/
nav ul ul {
background: #5f6975; border-radius: 0px; padding: 0;
position: absolute; top: 100%;
}
nav ul ul li {
float: none;
border-top: 1px solid #6b727c;
border-bottom: 1px solid #575f6a;
position: relative;
}
nav ul ul li a {
padding: 15px 40px;
color: #fff;
}
nav ul ul li a:hover {
background: #4b545f;
}
/**Sub Submenu**/
nav ul ul ul {
position: absolute; left: 100%; top:0;
}
/**#NavBar .subul_hidden
{
font:30px Georgia,serif;
display: none;
}
.NavLink
{
......@@ -66,7 +116,7 @@
border-right:4px solid black;
padding:0px 8px 6px 8px;
}
}
}**/
@-webkit-keyframes AnimLink /* Safari and Chrome */
{
0%
......
<script>
function addEnter(submenu)
{
$("#"+submenu).mouseenter(new function() {
$(this).toggleClass('subul_hidden subul_show');
});
}
function addLeave(submenu)
{
$("#"+submenu).mouseleave(new function() {
$(this).toggleClass('subul_show subul_hidden');
});
}
</script>
<nav id="navBar">
<?php
function SQL_QUERY_PARENT_ID($t_id,$t_SQL)
......@@ -19,7 +33,7 @@
{
if(!isset($level)||$t_depth == 0)
return "";
$navbar = " <ul>\r\n";
$navbar = "\r\n<ul id='SubMenu".$level[0][1]."' class='topul'>\r\n";
foreach($level as $page)
{
$id=$page[0];
......@@ -28,25 +42,43 @@
else
$linkType="NavLink";
$title=$page[2];
$navbar .= " <li id='NavId".$id."' class='".$linkType."'><a href='viewpage.php?id=".$id."'>".$title."</a>\r\n";
$navbar .= "<li id='NavId".$id."' class='topli ".$linkType."'><a href='viewpage.php?id=".$id."'>".$title."</a>";
if($page[0]!=0)
$navbar .= createLevel(SQL_QUERY_PARENT_ID($page[0],$t_SQL),$t_SQL,$t_select,$t_depth-1);
$navbar .= " </li>\r\n";
$navbar .= createSubLevel(SQL_QUERY_PARENT_ID($page[0],$t_SQL),$t_SQL,$t_select,$t_depth-1);
$navbar .= "</li>\r\n";
}
$navbar .= " </ul>\r\n";
$navbar .= "</ul>\r\n";
return $navbar;
}
function createSubLevel($level,$t_SQL,$t_select,$t_depth)
{
$count = 0;
if(!isset($level)||$t_depth == 0)
return "";
$navbar = "\r\n<ul id='SubMenu".$level[0][1]."' class='subul_hidden'>\r\n";
foreach($level as $page)
{
$count++;
$id=$page[0];
if($id==$t_select)
$linkType="NavSelected";
else
$linkType="NavLink";
$title=$page[2];
$navbar .= "<li id='NavId".$id."' class='".$linkType."'><a href='viewpage.php?id=".$id."'>".$title."</a>";
if($page[0]!=0)
$navbar .= createSubLevel(SQL_QUERY_PARENT_ID($page[0],$t_SQL),$t_SQL,$t_select,$t_depth-1);
$navbar .= "</li>\r\n";
}
$navbar .= "</ul>\r\n";
if($count > 0)
return $navbar;
else
return "";
}
$nav_SQL = $_GLOBAL["SQL"];
$nav_id = $_GLOBAL["pageId"];
$level = createLevel(SQL_QUERY_PARENT_ID(0,$nav_SQL),$nav_SQL,$nav_id,2);
echo $level;
?>
<!--
<ul>
<li id="NavId1" class="NavLink"><a href="viewpage.php?id=1">Home</a></li>
<li id="NavId2" class="NavLink"><a href="viewpage.php?id=2">About</a></li>
<li id="NavId3" class="NavLink"><a href="viewpage.php?id=3">Music</a></li>
<li id="NavId4" class="NavLink"><a href="viewpage.php?id=4">Technology</a></li>
</ul>
-->
</nav>
\ No newline at end of file
<?php
// ID PID Title Description Image Content
$pages = [[0,-1,"Home" , null , null ,"This is the homepage :)"],
[1, 0,"Page1" ,"Page 1 Description" , "./title.jpg" ,"This is page 1 html content"],
[2, 0,"Page2" ,"Page 2 Description" , "./title.jpg" ,"This is page 2 html content</br><button>Logon</button>"],
[3, 0,"Page3" ,"Page 3 Description" , "./title.jpg" ,"This is page 3 html content"],
[4, 0,"Page4" ,"Page 4 Description" , "./title.jpg" ,"This is page 4 html content"],
[5, 1,"Page5" , null , null ,"This is SUB page 5 html content"],
[6, 1,"Page6" , null , null ,"This is SUB page 6 html content"],
[7, 1,"Page7" , null , null ,"This is SUB page 7 html content"]
[5, 3,"Page5" , null , null ,"This is SUB page 5 html content"],
[6, 3,"Page6" , null , null ,"This is SUB page 6 html content"],
[7, 3,"Page7" , null , null ,"This is SUB page 7 html content"],
[8, 4,"Page8" , null , null ,"This is SUB SUB page 8 html content"]
];
// Name Password (Hashed) AccessLevel
$_GLOBAL["SQL"] = $pages;
if(isset($_GET["id"]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment