does .nav1 have an href equal to "#"?
try
return false;
at the end of the click callback.
Also, in my opinion, the best way to handle ajax loading in a navigation bar is to use the href value as the url that is used in the .load.
- <ul>
- <li><a class="nav" href="pages/home.html">Home</a></li>
- <li><a class="nav" href="pages/about.html">About</a></li>
- ...
- </ul>
- <script>
- $(document).ready(function(){
- $('.nav').click(function(e){
- e.preventDefault();
- $("#content").load($(this).attr('href'));
- });
- });
- </script>
This also allows for the navigation to still work when javascript is disabled.
-- Kevin