zoukankan      html  css  js  c++  java
  • jQuery:简单6行代码实现tab效果

    简简单单的6行代码实现tab滑动门效果:如下

    HTML:

    <div class="tabs">    <!-- 默认第一个tab为激活状态 -->        <h3 class="active"><span>热点新闻</span></h3>        <div id="tab-01">news</div>    <h3><span>娱乐新闻</span></h3>        <div id="tab-02">enteriment</div>        <h3><span>就业形势</span></h3>        <div id="tab-03">jobs</div>    </div>
    CSS:
      * { margin:0; padding:0;}    body { font:12px Verdana, Geneva, sans-serif; color:#404040;} .tabs { margin:10px 0 0 20px; 360px; position:relative; overflow:hidden; height:1%; height:140px;}.tabs h3 { z-index:2; font-size:12px; background:url(pic.gif) no-repeat; 95px; height:25px; line-height:25px; text-align:center; float:left; margin-right:5px;}h3.active { background-position:0 -25px; color:#fff;}#tab-01, #tab-02, #tab-03 { position:absolute; top:24px; left:0; 338px; padding:10px; height:93px; border:1px solid #ace; z-index:1;}#tab-02, #tab-03 { display:none;}
    JQUERY:
     $(document).ready(function() {$('.tabs h3').mouseover(function() {$('.tabs div').hide();$(this).siblings('h3').removeClass('active').end()  .addClass('active').next('div').show();});    });
    SHOW:

  • 相关阅读:
    kail
    scp命令
    搭建LNMP
    PHP7.3.2安装
    nginx的安装
    CentOS7部署NFS
    Linux使用mailx通过外部smtp发邮件
    kickstart自动化安装
    centos7下单用户模式,救援模式的应用以及虚拟机下的克隆
    putty和xsheel远程连接centos7
  • 原文地址:https://www.cnblogs.com/Leo_wl/p/1691620.html
Copyright © 2011-2022 走看看