切换效果
$("button").click(function() {
$(this).toggleClass("p")//获取p下标
var index=$(this).index();
$("p").eq(index).show(500)//显示p
$("p").eq(index).siblings().hide(500)//隐藏其他p
})
代码段:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/common.css" />
<style type="text/css">
button {
width: 150px;
height: 80px;
line-height: 80px;
fon