Hello Klaw,
I promised you to re-examine the matter as soon as I would be connected again, so here I am.
In menu.html, put:
Code:
<!doctype html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Navigation</title>
<script>
var menuids = new Array("verticalmenu") //Enter id(s) of UL menus, separated by commas
var submenuoffset = -2 //Offset of submenus from main menu. Default is -2 pixels.
function createcssmenu() {
for (var i = 0; i < menuids.length; i++) {
var ultags = document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t = 0; t < ultags.length; t++) {
var spanref = document.createElement("span")
spanref.className = "arrowdiv"
spanref.innerHTML = " "
ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
ultags[t].parentNode.onmouseover = function () {
this.getElementsByTagName("ul")[0].style.left = this.parentNode.offsetWidth + submenuoffset + "px"
this.getElementsByTagName("ul")[0].style.display = "block"
}
ultags[t].parentNode.onmouseout = function () {
this.getElementsByTagName("ul")[0].style.display = "none"
}
}
}
}
if (window.addEventListener) window.addEventListener("load", createcssmenu, false)
else if (window.attachEvent) window.attachEvent("onload", createcssmenu)
</script>
<style>
.glossymenu, .glossymenu li ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 185px;
/*WIDTH OF MAIN MENU ITEMS*/
border: 1px solid black;
}
.glossymenu li {
position: relative;
}
.glossymenu li a {
background: white url(http://www.kitz.me.uk/test/images/glossyback.gif) repeat-x bottom left;
font: bold 12px Verdana, Helvetica, sans-serif;
color: white;
display: block;
width: auto;
padding: 5px 0;
padding-left: 10px;
text-decoration: none;
}
.glossymenu li ul {
/*SUB MENU STYLE*/
position: absolute;
width: 190px;
/*WIDTH OF SUB MENU ITEMS*/
left: 0;
top: 0;
display: none;
}
.glossymenu li ul li {
float: left;
}
.glossymenu li ul a {
width: 180px;
/*WIDTH OF SUB MENU ITEMS - 10px padding-left for A elements */
}
.glossymenu .arrowdiv {
position: absolute;
right: 2px;
background: transparent url(http://www.kitz.me.uk/test/images/arrow.gif) no-repeat center right;
}
.glossymenu li a:visited, .glossymenu li a:active {
color: white;
}
.glossymenu li a:hover {
background-image: url(http://www.kitz.me.uk/test/images/glossyback2.gif);
}
/* Holly Hack for IE \*/
* html .glossymenu li {
float: left;
height: 1%;
}
* html .glossymenu li a {
height: 1%;
}
/* End */
</style>
</head>
<body>
<ul id="verticalmenu" class="glossymenu">
<li><a href="page1.html">Page 1</a></li>
<li><a href="page2.html">Page 2</a></li>
<li><a href="#">KLAW PAGES</a>
<ul>
<li><a href="page1.html">Page 1</a></li>
<li><a href="page2.html">Page 2</a></li>
</ul>
</li>
</ul>
</body>
</html>
In the other pages (I will call them page1.html and page2.html here) put:
page1.html:
Code:
<!doctype html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Navigation</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div id="nav" style="position: absolute; top: 30%"></div>
This is page 1
<script>
$('#nav').load('menu.html')
</script>
</body>
</html>
page2.html:
Code:
<!doctype html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Navigation</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div id="nav" style="position: absolute; top: 30%"></div>
<span style="color: red">This is page 2</span>
<script>
$('#nav').load('menu.html')
</script>
</body>
</html>
etc.
Bookmarks