jquery-table切换
来源:互联网 发布:防网络诈骗 编辑:程序博客网 时间:2024/06/05 23:56
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
span{
float: left;
width: 50px;
height: 30px;
background-color: yellow;
text-align: center;
}
.show{
width: 200px;
height: 150px;
background-color: gray;
color: white;
text-align: center;
line-height: 150px;
}
.hidden{
display: none;
}
</style>
</head>
<body>
<div>
<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
</div>
<div class="show">第一块</div>
<div class="show hidden">第二块</div>
<div class="show hidden">第三块</div>
<div class="show hidden">第四块</div>
</body>
<script src="js/jquery-3.2.1.min.js" ></script>
<script type="text/javascript">
$('span').on('click',function(){
$('span').css({'backgroundColor':'yellow'});
$('.show').css({'display':'none'});
$(this).css({'backgroundColor':'red'});
//$(this).css({'backgroundColor':'cyan'}).silbings().css({'':''});
// eq索引
$('.show').eq($(this).index()).css({'display':'block'});
});
</script>
</html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
span{
float: left;
width: 50px;
height: 30px;
background-color: yellow;
text-align: center;
}
.show{
width: 200px;
height: 150px;
background-color: gray;
color: white;
text-align: center;
line-height: 150px;
}
.hidden{
display: none;
}
</style>
</head>
<body>
<div>
<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
</div>
<div class="show">第一块</div>
<div class="show hidden">第二块</div>
<div class="show hidden">第三块</div>
<div class="show hidden">第四块</div>
</body>
<script src="js/jquery-3.2.1.min.js" ></script>
<script type="text/javascript">
$('span').on('click',function(){
$('span').css({'backgroundColor':'yellow'});
$('.show').css({'display':'none'});
$(this).css({'backgroundColor':'red'});
//$(this).css({'backgroundColor':'cyan'}).silbings().css({'':''});
// eq索引
$('.show').eq($(this).index()).css({'display':'block'});
});
</script>
</html>
阅读全文
0 0
- jquery table标签切换
- jquery-table切换
- jQuery学习笔记(2)--table标签切换
- javascript(jQuery版)切换table效果自动切换
- table切换
- table切换
- javascript(jQuery版)切换table效果自己动手丰衣足食
- jquery简单的table切换,在页面可以多次使用。
- jquery的ajax后台后去数据的table切换
- jQuery table
- JQuery Table
- JQuery (table)
- table jquery
- Jquery table
- table动态切换
- table切换代码
- table菜鸟切换
- table框的切换
- fl2440 palt_button.c驱动测试
- 人工智能相关书籍资料整理
- npm慢的解决办法
- 实现代码自动打包与发布(Jenkins+Maven+Svn)
- 1073:人民币问题
- jquery-table切换
- Android中WebView渲染显示web页面
- K尾相等数
- [POJ2485]Highways
- linux下系统启动时,几个配置文件 /etc/profile、~/.bash_profile 等几个文件的执行过程,先后顺序
- Java中的String、正则表达式
- LeetCode:647. Palindromic Substrings
- linux安装mysql
- Qt使用QWebengineView导致花屏和黑屏现象