zoukankan      html  css  js  c++  java
  • tab------左右布局

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title></title>
    <style type="text/css">
    *{margin: 0;padding: 0;}
    #box{ 880px;height: 480px;border: 1px solid #ddd;margin: 100px auto;}
    #box .list{ 180px;border-right:1px solid #ddd ;height: 480px;float: left;}
    #box .list li{height: 45px;border-bottom:1px solid #ddd ;list-style: none;line-height: 45px;font-size: 16px;text-align: center;}
    #box .con{ 698px;height: 400px;background: #ccc;float: left;overflow: hidden;}
    #box .on{background: #ccc;}

    #box .con div{
    695px;height: 480px;font-size: 14px;text-align: center;
    }
    #box .con div:nth-child(1){
    background: palegreen;
    }
    #box .con div:nth-child(2){
    background:orange;
    }
    #box .con div:nth-child(3){
    background:palevioletred;
    }
    #box .con div:nth-child(4){
    background:blueviolet;
    }
    #box .con div:nth-child(5){
    background:brown ;
    }
    </style>
    </head>
    <body>
    <div id="box">
    <div class="list">
    <ul>
    <li class="on">哈哈</li>
    <li>嘻嘻</li>
    <li>喵喵</li>
    <li>某某</li>
    <li>喳喳</li>
    </ul>
    </div>
    <div class="con">
    <div>哈哈啊哈哈</div>
    <div>嘻嘻嘻嘻嘻嘻嘻</div>
    <div>喵喵密密麻麻</div>
    <div>某某某某某某</div>
    <div>扎扎扎扎咋呼咋哈</div>
    </div>
    </div>

    <script type="text/javascript" src="js/jquery-3.1.0.min.js" ></script>
    <script type="text/javascript">
    $(function(){
    var $li = $(".list li");
    var $conDiv = $(".con div");

    $li.mouseover(function(){
    var $index = $(this).index();
    $(this).addClass("on").siblings().removeClass("on");
    $conDiv.eq($index).show().siblings().hide();
    });
    })
    </script>
    </body>
    </html>

  • 相关阅读:
    Hibernate学习笔记
    Oracle12c 在windonServer2012中安装的步骤
    提升tomcat服务器性能的七条经验
    zyUpload---照片上传并显示效果
    js的隐含参数(arguments,callee,caller)使用方法
    js中callback.call()和callback()的区别
    理解javascript中的回调函数(callback)
    Spring MVC 流程图
    JDBC在springMvc等框架中使用的方式
    为IE8添加EventListener系列方法支持
  • 原文地址:https://www.cnblogs.com/qiyc/p/5886802.html
Copyright © 2011-2022 走看看