Can't preview jQuery / Is my code wrong or is it just not previewing??
Hello,
I am using jQuery in my html script in DreamWeaver. I think I coded it correctly, but whenever I preview whether it's in Firefox or in live view, I can't get it to work. What's supposed to happen is when I click an image with the class "menu_head," the rest of the navigation in the list classified as "menu_body" is supposed to appear. When I click, however, nothing happens. I don't know if I maybe sourced my javascript file wrong or what??
Here's my html code so far with the javascript.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Amyris</title>
<link href="main.css" rel="stylesheet" type="text/css" />
<script src="jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("ul.menu_body li:even").addClass("alt");
});
$("img.menu_head").click(function () {
$("ul.menu_body").slideToggle("medium");
});
</script>
</head>
<body>
<div id="wrapper">
<div id="nav"></div>
<img src="images/images/menu.png" width="183" height="42" class="menu_head" />
<ul class="menu_body"><br>
<li><a href="#">About Us</a></li><br>
<li><a href="#">Portfolio</a></li><br>
<li><a href="#">Clients</a></li><br>
<li><a href="#">Blog</a></li><br>
<li><a href="#">Support Forums</a></li><br>
<li><a href="#">Gallery</a></li><br>
<li><a href="#">Contact Us</a></li><br>
</ul>
</div>
</body>
</html>