超简单TAB切换
<div class="tab-fbox2">
<ul class="title-list2 clearfix">
<li class="active2">第一个</li>
<li>第二个</li>
<li>第三个</li>
<li>第三个</li>
</ul>
<div class="tcont-box2">
<div class="tcont2" style="display:block;">第一个的内容</div>
<div class="tcont2">第二个的内容</div>
<div class="tcont2">第三个的内容</div>
<div class="tcont2">第三个的内容</div>
</div>
</div>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(function(){
$('.tab-fbox2').on('mouseover', '.title-list2 li', function(e){
var index = $(this).index();
$(this).addClass('active2').siblings().removeClass('active2');
$(e.delegateTarget).find('.tcont2').eq(index).show().siblings().hide();
}); });
</script>
style样式
.tab-fbox2{ width:500px; margin:20px 0 0 50px;}
.tab-fbox2 .title-list2 li{ float:left; width:100px; height:20px; text-align:center; line-height:20px; background-color:#000; color:#fff; border-right:solid 2px #fff; cursor:pointer;}
.tab-fbox2 .title-list2 li.active2{ background-color:#f00;}
.tab-fbox2 .tcont-box2{ border:solid 1px #000; height:300px;}
.tab-fbox2 .tcont-box2 .tcont2{ display:none;}
超简单TAB切换的更多相关文章
- 简单Tab切换
延迟Tab切换,使用css中的flex布局,原生js实现.(京东首页菜单也有此延迟功能哦!) 每天进步一丢丢~~ 1.延迟Tab切换 <!DOCTYPE html> <html la ...
- jquery实现简单的Tab切换菜单
实现tab切换的主要html代码: <div class="container"> <ul class="tabs"> <li c ...
- jquery写的tab切换效果 非常简单
自己写的一款 tab切换效果,比较简单,适合新手 <style type="text/css">*{margin:0; padding:0; font-size:12p ...
- 简单的Tab切换组件
由于代码都有注释,所以不多加解释,大家都知道的.直接贴代码: 代码如下: /** * 简单的Tab切换 * 支持可配置项 如下参数 */ function Tab(){ this.config = { ...
- react简单的tab切换 (styled-components)
其实,在我们日常的编程当中,经常会碰到tab切换的模块,那么,实现他的方法也有很多中,下面是一款简单,容易理解的react tab切换方法. 通过设置state中的current 属性去控制tab 和 ...
- DIV+CSS 样式简单布局Tab 切换
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> &l ...
- jquery实现tab切换完整代码
代码如下,保存到html文件打开: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...
- CSS3 :target伪类实现Tab切换效果
用:target伪类实现Tab切换效果真的非常简单!简单到什么程度呢?它只需要下面这些代码. style.css: .song-info { position: absolute; backgroun ...
- react实现的tab切换组件
我有点想要吐槽,因为用原生的js实现起来挺简单的一个小东西,改用react来写却花了我不少时间,也许react的写法只有在复杂的web应用中才能体现出它的优势吧!不过吐槽归吐槽,对react这种优雅的 ...
随机推荐
- ChildNodes详解及其兼容性处理方式
写在前面:在做insertBefore插入节点练习时发现一个问题,插入childNodes[0]和childNodes[1]时插入的位置是一样的!于是有了childNodes的了解,有了这篇文章,欢迎 ...
- asp.net uploadfile 上传文件,连接已重置问题
修改web.config中的配置 <httpRuntime maxRequestLength="/> //设置上传文件大小(kb)和响应时间(s) 针对iis7或更高版本另需要在 ...
- hdu1251统计难题
Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己 ...
- "Classifying plankton with deep neural networks" notes
cross entropy loss is not quite the same as optimizing classification accuracy. Althougth the two ar ...
- Android动画之硬件加速
你的动画写出来卡嘛?流畅嘛 如果你想提升动画的性能,那就是用它-hardware layers. During animations your views may be redrawn each fr ...
- CI的扩展机制
CI的扩展机制 在熟悉了CI的源码之后,它的简单明了的代码风格很有趣,这篇文章看看在CI是如何实现扩展的. 扩展包 扩展是为了完成特定的功能,在CI中,扩展包的开发只能在application/lib ...
- python 中去除BOM头
在window的环境下,保存的文本文档会加上三个字符0xEF 0xBB 0xBF的头部,这三个字符可能会影响对文本的读取,形成乱码,在这里记录下如何避免. 首先发现直接保存为ASCII的文本文件是不包 ...
- Linux 计算某文件夹下的所有文件的md5值
使用find 命令 find /root -type f -print0 |xargs -0 md5sum >a.md5 校验的话 md5sum -c a.md5
- 动态创建分页 LINQ+EF
public class Message { public int MessageId { get; set; } public string MessageTitle { get; set; } p ...
- 【Chromium中文文档】Chrome/Chromium沙箱 - 安全架构设计
沙箱 转载请注明出处:https://ahangchen.gitbooks.io/chromium_doc_zh/content/zh//General_Architecture/Sandbox.ht ...