I am try to build a menu for my personal webpage which would load a html file into a contents div when I click on the corresponding link on the menu. The layout is what I want, but unfortunately I cannot get the click event to work. This is what I have:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Jorge Martins' HomePage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="styles.css" media="all" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script language="javascript">
$(document).ready(function () {
$('li.about').click(function(){
$('#content').load( 'about.html' );
});
$('#research').click(function(){
$('#content').load( 'about.html' );
});
});
</script>
</head>
<body>
<div>
<ul class="menu">
<li id="home">Home</li>
<li class="about">About me</li>
<li id="research">Research</li>
<li id="publications">Publications</li>
</ul>
</div>
<div id="content">
</div>
</body>
</html>
and the css:
ul.menu {
margin: 0;
padding: 0;
float:left;
width: 15%;
margin: 10px;
}
ul.menu li {
list-style: none;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:24px;
font-weight:bold;
color: #555;
height: 32px;
voice-family: "\"}\"";
voice-family: inherit;
height: 24px;
text-decoration: none;
}
ul.menu li:hover {
color: #FFF;
/*padding: 0px 0 0 0px;*/
}
#content {
width: 75%;
float:left;
margin: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: bold;
color: #555;
}
Any idea on what I've done wrong?
Thanks.
EDIT: Removed extra tab as per Joe's comment.