zoukankan      html  css  js  c++  java
  • 左侧滑动菜单

    <!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=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
    <script type="text/javascript">
          $(document).ready(function(){
            
            $('.box h1:first').addClass('active');
            
            $('.box p:not(:first)').hide();
            
            $('.box h1').hover(function(){
                
            $(this).addClass('hover');
            },function(){

            $(this).removeClass('hover');    

                });
             $('.box h1').click(function(){
                
                $(this).next('p').slideToggle()
                
                        .siblings('p').slideUp();    
                
                $(this).toggleClass('active')
                
                        .siblings('h1').removeClass('active');

                });
        
            });
    </script>
    <style type="text/css">
    * { padding:0; margin:0; }

    body { padding:100px; font:12px "宋体"; }

    .box { 500px; border-bottom:1px solid #CCC; }

    .box h1 { height:30px; line-height:30px; padding:0 10px; font-size:12px; cursor:pointer; border:1px solid #ccc; border-bottom:none; background:#eee url(img/bg.gif) no-repeat right -27px; }

    .box h1.hover { background-color:#e3e2e2; }

    .box h1.active { background-position:right 7px; }

    .box p { padding:10px; border-left:1px solid #ccc; border-right:1px solid #ccc; }
    </style>
    </head>

    <body>
    <div class="box">
      <h1>标题一</h1>
      <p>内容</p>
      <h1>标题二</h1>
      <p>内容</p>
      <h1>标题三</h1>
      <p>内容</p>
      <h1>标题四</h1>
      <p>内容</p>
      <h1>标题五</h1>
      <p>内容</p>
    </div>
    </body>
    </html>

  • 相关阅读:
    Google 开源的 Python 命令行库:深入 fire(二)
    开启 Django 博客的 RSS 功能
    MongoDB 分片键的选择与案例
    Log4Net写入到数据库配置过程中的一些小问题备忘
    《WCF服务编程第三版》知识点摘录
    Android调用基于.net的WebService
    心跳包实现的另一种机制
    无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。
    解决SaveChanges会Hold住之前的错误的问题
    memcached工作原理与优化建议
  • 原文地址:https://www.cnblogs.com/zhouyx/p/4120324.html
Copyright © 2011-2022 走看看