zoukankan      html  css  js  c++  java
  • [html]选项卡效果

    <!doctype html>
    <html>
     <head>
      <meta charset="UTF-8">
      <title>Document</title>
      <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
      <style type="text/css">
        .menu{background:#eee; border-bottom:1px solid #0f52a4;}
        a{
          display:inline-block;
          width:100px;
          height:36px;
          line-height:36px;
          text-align:center;
          color: #0f52a4;
          font-weight: bold;
          text-decoration: none;
          position:relative;
          top:1px;
        }
        .current a{
          background:#fff;
          border-top:2px solid #0f52a4;
        }
        div div{
          display:none;
          border-bottom:1px solid #0f52a4;
        }
      </style>
      <script type="text/javascript">
        $(function(){
            $('div div:first').show();
            $('span').mouseenter(function(){
                $('span').removeClass('current');
                $(this).addClass('current');
                $('div div').hide();
                $('div div').eq($('span').index(this)).show();
            });
        });
      </script>
     </head>
     <body>
     <div class="menu">
      <span class="current"><a href="#">晨间新闻</a></span>
      <span><a href="#">午间新闻</a></span>
      <span><a href="#">晚间新闻</a></span>
      <span><a href="#">视频新闻</a></span>
     </div>
     <div>
      <div>晨间新闻</div>
      <div>午间新闻</div>
      <div>晚间新闻</div>
      <div>视频新闻</div>
     </div>
     </body>
    </html>

     本文内容参考:http://h-ui.net/Hui-4.5-tab.shtml

  • 相关阅读:
    oo第四次总结
    oo第三次总结
    补给站总结
    OO第四次单元总结
    OO第三次单元总结
    OO第二次单元总结
    OO第一次单元总结
    提问回顾与个人总结
    软件工程结对作业博客
    OO第一次单元总结
  • 原文地址:https://www.cnblogs.com/z5337/p/5608763.html
Copyright © 2011-2022 走看看