使用jquery实现斑马线效果 如题:我做了个网页,需要这样实现,第一行是背景是蓝色的,第二行和第三行是白色的,第四行是蓝色的,第五行和第六行是白色的,第七行是蓝色的,以此类推每个两行显示一个蓝色背景的,请问用jquery或者js怎样实现???????、 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://v3.thewatchmakerproject.com/zebra.html $(function(){ $("tr").each(function(i){ //我这里假设的是tr,根据LZ自己的来 if(i % 3 == 0) $(this).css("background-color","blue"); else $(this).css("background-color","white"); }); }); 也可以: $("table").css("backgroundColor", "#0000ff"); $("tr").each(function(index) { $(this).not(":eq(" + index % 3 + ")").css("backgroundColor", "#fff"); } $("table").css("backgroundColor", "#0000ff"); $("tr").each(function(index) { $(this).not(":eq(" + index % 3 + ")").css("backgroundColor", "#fff"); }); 大家好,请问C#如何制作网络版的注册机程序? 正则表达式 类怎么引用啊!有没有人帮忙看看,,, 异常来自 HRESULT:0x800A03EC 怎么样才有钱 c#如何得到当前ie的句柄?得到句柄后如何操作当前IE? 我已经知道TreeView中一个节点的ID,如何定位到该结点? 菜菜的问:发觉event的功能delegate都能直接实现,那么为啥要有event呢? WCF,访问数据库 在线急等,求记录C#程序崩溃的DUMP 代码。 请问这个控件如何用。 clickonce 出错: 您的 Web 浏览器设置不允许您运行未签名的应用程序
$(function(){
$("tr").each(function(i){ //我这里假设的是tr,根据LZ自己的来
if(i % 3 == 0)
$(this).css("background-color","blue");
else
$(this).css("background-color","white");
});
});
$("table").css("backgroundColor", "#0000ff");
$("tr").each(function(index) {
$(this).not(":eq(" + index % 3 + ")").css("backgroundColor", "#fff");
}
$("tr").each(function(index) {
$(this).not(":eq(" + index % 3 + ")").css("backgroundColor", "#fff");
});