DreamWeaverCS5+JQuery写的简单的导航栏

来源:互联网 发布:淘宝标题优化技巧视频 编辑:程序博客网 时间:2024/06/01 18:05

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
  .menu{ width:300px;}
  .haschilden{height:40px;width:80px;background : #555;color :#fff;cursor:pointer;float:left;margin-left:1px;padding-top:20px;text-align:center;}
  .zh{ border-width:1px; border-style:solid; border-color:#F00; cursor:pointer; margin-left:1px; display:none;}
  .highlight{ background-color:#F9F}

</style>
<script src="jquery-1.7.js" type="text/javascript"></script>
<script type="text/javascript">
   $(function(){

 $(".haschilden").mouseover(function(){
                 $(this).addClass("highlight").siblings().removeClass("highlight");
                });


       $(".menu div span").mouseover(function(){
          var index=$(".menu div span").index(this);
          $("#div1 .aa  div div").eq(index).show().parent().siblings("div").children().hide();
          
           });
       });
</script>
</head>

<body>
<div class="menu">
   <div class="haschilden">
       <span>中国</span>
   </div>
   <div class="haschilden">
       <span>美国</span>
   </div>
   <div class="haschilden">
       <span>日本</span>
   </div>
</div>


<div id="div1">
   <div class="aa">
   
      <div>
          <div class="zh">
            <a>1.1-JavaScript和JavaScript库</a><br />
            <a>1.2-加入jQuery</a><br />
            <a>1.3-编写简单jQuery代码</a><br />
            <a>1.4-jQuery对象和DOM对象</a><br />
            <a>1.5-解决jQuery和其它库的冲突</a><br />
            <a>1.6-jQuery开发工具和插件</a><br />
            <a>1.7-小结</a>
          </div>
      </div>
    
      <div>
          <div class="zh">
              <a>2.1-jQuery选择器是什么</a><br />
              <a>2.2-jQuery选择器的优势</a><br />
              <a>2.3-jQuery选择器</a><br />
              <a>2.4-应用jQuery改写示例</a><br />
              <a>2.5-选择器中的一些注意事项</a><br />
              <a>2.6-案例研究——类似淘宝网品牌列表的效果</a><br />
              <a>2.7-还有其它选择器么?</a><br />
              <a>2.8-小结</a>
          </div>
      </div>
    
      <div>
          <div class="zh">
            <a>3.1-DOM操作的分类</a><br />
            <a>3.2-jQuery中的DOM操作</a><br />
            <a>3.3-案例研究——某网站超链接和图片提示效果</a><br />
            <a>3.4-小结</a>
          </div>
      </div>
      
    </div>
 </div>
 

</body>
</html>


原创粉丝点击