Menu
Hi!
So, I have been beginning to learn HTML/JS to help build and maintain some websites for some organizations that I belong to.
I have written the html, and have tried to include some free JS scripts I have found. However, it is not quite working and that got me thinking about how to debug in these languages.
I used to program in a server-side language where I would set data in global variables which I would later check to see what my code was doing, and in VB where I could trace through the code step by step.
However, I have not yet been able to think of a way to do a similar thing in HTML/JS.
Thanks!
<i>
</i><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MEDiC</title>
<link type="text/css" rel="stylesheet" href="MEDiC.css" />
</head>
<body>
<div id="header">
<p>
<img src="header.JPG" height="160" width="900" alt="MEDiC" />
</p>
<br />
</div>
<br />
<div id="sidebar">
<ul>
<li><a href="index.html" title="MEDiC">Home</a></li>
<li><a href="clinics.html" title="Clinics">Clinics</a></li>
<li><a href="read.html" title="Reach Out and Read">Reach Out and Read</a></li>
<li><a href="Volunteer.html" title="Volunteer">Volunteer</a></li>
<li><a href="Calendar.html" title="Calendar">Calendar</a></li>
<li><a href="ClinicResources.html" title="Clinic Resources">Clinic Resources</a></li>
<li><a href="Donate.html" title="Donate">Donate</a></li>
<li><a href="Newsletter.html" title="Newsletter">Newsletter</a></li>
<li><a href="Handbook.html" title="MEDiC Handbook">MEDiC Handbook</a></li>
<li><a href="Contact.html" title="Contact Information">Contact Information</a></li>
</ul>
</div>
<div id="calendar">
<p>Calendar goes here</p>
</div>
<i> </i> <div id="main">
<i> </i><h1> Announcements</h1>
<i> </i><ul>
<i> </i></ul>
<i> </i><h1> Mission Statement</h1>
<i> </i><p>
<i> </i><ul>
<i> </i> <li>To provide quality health care services to the underserved</li>
<i> </i> <li>To assist in the training and development of health professions students</li>
<i> </i> </ul>
<i> </i></p>
<i> </i><br />
<i> </i><br />
<i> </i></div>
</body>
</html>
<i>
</i>body {
margin: 0;
padding: 5px;
font-family: Verdana, Geneva, Arial, sans-serif;
font-size: small;
line-height: 1.6em;
}
#sidebar {
float: left;
}
#sidebar ul {
list-style-type: none;
padding: 0px 0px 0px 0px;
margin: 0;
width: 170px;
font-size: 100%;
}
#sidebar li {
margin: 0;
}
#sidebar a {
text-decoration: none;
font-weight: bold;
display: block;
padding: 3px 12px 3px 8px;
background-color: rgb(128,3,21);
color: rgb(255,255,255);
border-top: 1px solid rgb(205,40,15);
border-right: 1px solid rgb(120,40,55);
border-bottom: 1px solid rgb(120,40,55);
border-left: 1px solid rgb(205,40,15);
}
#sidebar a:hover {
background-color: rgb(210,40,20);
}
#sidebar a:active {
padding: 2px 13px 4px 7px;
background-color: rgb(255,40,45);
color: rgb(200,210,20);
border-top: 2px solid rgb(140,40,50);
border-right: 2px solid rgb(200,40,20);
border-bottom: 2px solid rgb(200,40,20);
border-left: 2px solid rgb(140,40,50);
}
#calendar {
float: right;
width: 160px;
height: 160px;
margin-left: 20px;
margin-bottom: 20px;
border: 2px ridge black;
background-color:rgb(220,215,25);
}
#header {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
height: 160px;
border-bottom: 5px ridge rgb(220,215,25);
}
#main {
margin-top: 5px;
float: right;
width: 800px;
}
h1 {
font-size: 1.5em;
background-color: rgb(128,3,21);
color: rgb(255,255,255);
border: 1px solid rgb(120,40,55);
}
h2 {
font-size: 1.2em;
color: rgb(50, 205, 50);
}
<i>
</i><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MEDiC</title>
<link type="text/css" rel="stylesheet" href="MEDiC.css" />
<script type="text/javascript" src="vb_menu.js"></script>
</head>
<body>
<div id="header">
<p>
<img src="header.JPG" height="160" width="900" alt="MEDiC" />
</p>
<br />
</div>
<br />
<div id="MenuLine" style="position:relative;"></div>
<script language="JavaScript" src="theMenu.js"></script>
<i> </i> <div id="calendar">
<i> </i> <p>Calendar goes here</p>
<i> </i> </div>
<i> </i> <div id="main">
<i> </i><h1> Announcements</h1>
<i> </i><ul>
<i> </i></ul>
<i> </i><h1> Mission Statement</h1>
<i> </i><p>
<i> </i><ul>
<i> </i> <li>To provide quality health care services to the underserved</li>
<i> </i> <li>To assist in the training and development of health professions students</li>
<i> </i> </ul>
<i> </i></p>
<i> </i><br />
<i> </i><br />
<i> </i></div>
</body>
</html>
<i>
</i>body {
margin: 0;
padding: 5px;
font-family: Verdana, Geneva, Arial, sans-serif;
font-size: small;
line-height: 1.6em;
}
a.MenuLink{
color:#1D2123;
width:100%;
text-decoration: none;
}
/* Menu Link when the mouse is over */
a.MenuLink:hover{
color:#AA0000;
background-color:#FFFF99;
text-decoration: underline;
}
/* First menu link element */
div.FirstMenuElement{
font: 12px Geneva, Arial, Helvetica, sans-serif;
position:absolute;
padding:3px;
width:130px;
text-align: center;
background-color:#82A6C4;
border: solid #475156 1px;
display:none;
}
/* commented sections from <a href="http://javascript.internet.com/navigation/vb-menu.html">http://javascript.internet.com/navigation/vb-menu.html</a> */
/* First menu link element when the mouse is over */
div.FirstMenuElementOver{
font: 12px Geneva, Arial, Helvetica, sans-serif;
position:absolute;
width:130px;
padding:3px;
text-align: center;
background-color:#FFFF99;
border: solid #475156 1px;
}
/* Menu link element */
div.MenuElement {
font: 12px Geneva, Arial, Helvetica, sans-serif;
position:absolute;
padding:3px;
width:150px;
background-color:#EFEFFF;
border: solid #475156 1px;
display:none;
}
/* Menu link element when the mouse is over */
div.MenuElementOver {
font: 12px Geneva, Arial, Helvetica, sans-serif;
position:absolute;
padding:3px;
width:150px;
background-color:#FFFF99;
border: solid #475156 1px;
}
#calendar {
float: right;
width: 160px;
height: 160px;
margin-left: 20px;
margin-bottom: 20px;
border: 2px ridge black;
background-color:rgb(220,215,25);
}
#header {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
height: 160px;
border-bottom: 5px ridge rgb(220,215,25);
}
#main {
margin-top: 5px;
float: right;
width: 800px;
}
h1 {
font-size: 1.5em;
background-color: rgb(128,3,21);
color: rgb(255,255,255);
border: 1px solid rgb(120,40,55);
}
h2 {
font-size: 1.2em;
color: rgb(50, 205, 50);
}
[code] existed. Thanks for the tip!.
The CSS is included in <head> as a separate css style sheet file. The "old" code I wrote works, so I know its calling the style sheet. I have made the CSS separate [code] sections to reflect them being distinctly separate files. the .js files are unchanged.
0.1.9 — BETA 5.18