点击显示底框颜色,默认显示第一个。
2016-08-31 11:21
169 查看
页面初始化显示第一个底框颜色,点击另一个第一个底框颜色消失,被点击的底框颜色显示,以此循环。
或者:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="" /> <style type="text/css"> .box{width:800px;border:1px solid red;height:600px;margin:0 auto;} .zc{float:left;margin-right:50px;} ul {list-style:none;} a{text-decoration:none;} .box_nei{height:40px;line-height:40px;border-bottom:8px solid #E5E5E5;} .box_nei li a:hover{ font-size:18px; color:#666666 ; } .box_nei li a.hover{ font-size:18px; color:#666666 ; border-bottom:8px solid #C30D23;} .box_nei li a{ font-size:18px; color:#666666; width:124px; height:40px; line-height:40px; display:block;} .help_now{border-bottom:6px solid #C30D23;} </style> <script type="text/javascript" src="jquery-1.7.1.min.js"></script> <script type="text/javascript"> $(function(){ $(".zc").click(function(){ $(this).addClass('help_now').siblings().removeClass("help_now"); }); $('#zcc').addClass('help_now'); }); </script> </head> <!--要求默认显示一个红色底框;点击另一个这个消失另一个显现红色底框--> <body> <div class="box"> <div class="box_nei"> <ul> <li class="zc" id="zcc"> <a id="zc" href="#"> 注册指南 </a> </li> <li class="zc" > <a id="ass" href="#">新手必读</a> </li> <li class="zc" > <a id="sf" href="#">收费标准</a> </li> <li class="zc" > <a id="cj" href="#">常见问题 </a> </li> </ul> </div> <div> </body> </html>
或者:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="" /> <style type="text/css"> .box{width:800px;border:1px solid red;height:600px;margin:0 auto;} .zc{float:left;margin-right:50px;} ul {list-style:none;} a{text-decoration:none;} .box_nei{height:40px;line-height:40px;border-bottom:8px solid #E5E5E5;} .box_nei li a:hover{ font-size:18px; color:#666666 ; } .box_nei li a.hover{ font-size:18px; color:#666666 ; border-bottom:8px solid #C30D23;} .box_nei li a{ font-size:18px; color:#666666; width:124px; height:40px; line-height:40px; display:block;} .help_now{border-bottom:6px solid #C30D23;} </style> <script type="text/javascript" src="jquery-1.7.1.min.js"></script> <script type="text/javascript"> $(function(){ $(".zc").eq(0).addClass('help_now'); $(".zc").click(function(){ $(this).addClass('help_now').siblings().removeClass("help_now"); }); }); </script> </head> <!--要求默认显示一个红色底框;点击另一个这个消失另一个显现红色底框--> <body> <div class="box"> <div class="box_nei"> <ul> <li class="zc help_now"> <a id="zc" href="#"> 注册指南 </a> </li> <li class="zc" > <a id="ass" href="#">新手必读</a> </li> <li class="zc" > <a id="sf" href="#">收费标准</a> </li> <li class="zc" > <a id="cj" href="#">常见问题 </a> </li> </ul> </div> <div> </body> </html>
相关文章推荐
- 取消默认Listview点击的显示的颜色
- android gridview默认显示部分数据,点击按钮显示全部,再点击回到默认状态,选中变颜色
- 网页中有两个table, 默认只显示第一个table,点击一个按钮后显示第二个table,第一个table隐藏
- 鼠标指向表格中的一行时,该行背景色改变;点击行时,突出显示标记颜色
- winform中DataGridView添加ComboBox的最终解决方案(点击ComboBox默认显示当前行的内容)
- 修改点击cell时显示的颜色
- 鼠标指向表格中的一行时,该行背景色改变;点击行时,突出显示标记颜色
- gallery 从最左边开始显示并且默认选中第一个
- 多图展示点击切换效果模拟的flash效果,点小图放大显示,再点恢复默认。
- c# comboBox绑定数据后会默认显示第一个值
- 自动变色的小程序(点击可停止变色也可显示当前颜色的16进制数)
- 黑马程序员之WinForm编程基础学习笔记:页面上有一张图片,默认是隐藏的,用户在文本框中输入身份证号(131226198105223452),点击按钮,如果年龄大于18岁则显示图片。
- autocomplete.jquery 点击或进入默认显示所有结果
- 默认隐藏内容,点击标题显示内容。
- ListView中设置item的背景色后,默认的行点击颜色失效的解决办法
- 如何使已经有选中项的ComboBox在点击下拉箭头时,仍然默认从列表开始处显示,而不是跳到选中项的位置
- js实现默认文本框信息 鼠标点击时没有离开时显示
- 树状菜单 点击一个关闭另一个 默认第一个栏目的子栏目展开
- 点击listitem按下效果替换默认颜色
- 文本框默认显示的字(提示的文字),点击后文字消失。