li隔行换色改进版
ghhs("nav01","li"); // 鼠标经过时变色
ghhs("nav02","li","no"); // 只隔行换色
ghhs("nav03","li","onclick"); // 鼠标点击当前标记变色
隔行换色 - www.jb51.net 我们
// 返回Id、Tag
function Pid(id,tag){
if(!tag){return document.getElementById(id);}
else{return document.getElementById(id).getElementsByTagName(tag);}
}
// 隔行换色
function ghhs(id,tag,s) {
var line=Pid(id,tag);
for (var i=1;i0)?"t1":"t2";
}
if(s=="no"){
return;
}
else if(!s){
for(var i=0;i
.t1 {background:#eee;}
.t2 {background:#fff;}
.up {background:#ddd;}
- 路过
- asdsad
- asdsad
- asdsad
- 无视路过
- asdsad
- asdsad
- asdsad
- 踩我
- asdsad
- asdsad
- asdsad
ghhs("nav01","li");
ghhs("nav02","li","no");
ghhs("nav03","li","onclick");
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
相关推荐
-
JS控制表格隔行变色
<table width="800" border="0" cellpadding="0" cellspacing="0"> <tr> <td>不变色</td> </tr> <tbody id="goaler"> <tr> <td>xxxxxxxx</td
-
Js 实现表格隔行换色一例
Js实现表格隔行换色一例 body{ padding:0; margin:0; font:Arial; font-size:12px;} .bf{ padding:0; margin:auto;} .bf table{ text-align:center;line-height:14pt;} .bf th{ width:50px; padding:10px;} .f1{ background:#fff8f0;} .f2{ background:#f0f7ff;} .f3{ background:
-
js隔行变色、鼠标划过变色代码
隔行变色且鼠标划过变色的效果 .container ul{margin:0;padding:0;} .container li{cursor:pointer;height:30px;width:200px;background-color:#FFC;line-height:30px;text-indent:1em;font-size:12px;} .container .change{cursor:pointer;height:30px;width:200px;background-color:
-
li隔行换色效果代码升级版
隔行换色 2 - www.jb51.net 0)?"t1":"t2"; } if(s=="no"){ return; } else if(!s){ for(var i=0;i 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
-
JS小功能(列表页面隔行变色)简单实现
效果: 代码: 复制代码 代码如下: <head runat="server"> <title></title> <script type="text/javascript"> window.onload = function () { var otab = document.getElementById('tab1'); var thiscolor
-
js取模(求余数)隔行变色
复制代码 代码如下: <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>js取模隔行变色</title><script type="text/javascript"
-
jQuery隔行变色与普通JS写法的对比
复制代码 代码如下: <style type="text/css"> body { font-size:12px;text-align:center; } #tbStu { width:260px;border:1px solid #666;background-color:#eee; } #tbStu tr { line-height:23px; } #tbStu tr th { background-color:#ccc;color:#fff; } #tbStu .tr
-
JS+CSS实现Li列表隔行换色效果的方法
本文实例讲述了JS+CSS实现Li列表隔行换色效果的方法.分享给大家供大家参考.具体实现方法如下: 复制代码 代码如下: <!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/xh
-
js 表格隔行颜色
通过判断是否为单数即可 然后设置下行的背景颜色就可以了 if(i%2==1) row.style.background = "#CCCCff"; else row.style.background = "#CCCCCC";
-
JS实现简洁(隔行换色、高亮显示)表格特效
JS实现的表格 document.write(' '); var i=0; while(i') } document.write(' '+i+' '); i++; //document.write(' '); } if(i%10==0){ document.write(' '); } document.write(' '); var ys=null; function show(obj){ ys=obj.bgColor; obj.bgColor="red"; } function no
随机推荐
- golang之log rotate详解
- ubuntu下使用SQLite3的基本命令
- SQL Server 2008用'sa'登录失败,启用'sa'登录的解决办法
- linux touch,chattr指令详解及用法
- IOS UITableView和NavigationBar的常用设置详解
- python用于url解码和中文解析的小脚本(python url decoder)
- 在Windows下编译适用于PHP 5.2.12及5.2.13的eAccelerator.dll(附下载)
- php实现指定字符串中查找子字符串的方法
- Bootstrap进度条组件知识详解
- 利用JS解决ie6不支持max-width,max-height问题的方法
- PHP Zip解压 文件在线解压缩的函数代码
- Oracle重建索引Shell脚本、SQL脚本分享
- 重新应用默认的安全设置 : 安全配置和分析
- Bootstrap栅格系统的使用详解
- Android自定义View绘图实现渐隐动画
- JAVA-NIO之Socket/ServerSocket Channel(详解)
- Android 沉浸式状态栏及悬浮效果
- 告别平凡 给窗口换上漂亮的新装
- ssh更改默认端口号及实现免密码远程登录
- 详解spring cloud构建微服务架构的网关(API GateWay)
