62,074
社区成员
发帖
与我相关
我的任务
分享
<table id="dtlWorksList" class="tasklist" cellspacing="0" border="0" style="border-collapse:collapse;">
<tr>
<td>
<table width="590" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#eeeeee">
<tr>
<td width="590" valign="top" bgcolor="#FFFFFF">
<table width="590" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="590" height="25" class="linebotxx2">
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="420">
任务已浏览 <span class="textbluec">投稿时间:</span><span class="textred">2011-9-17 11:43:00</span></td>
<td width="140" style="float:right; margin-right:0px; vertical-align:middle">
<a id="tongguo" href="javascript:Awards(3,31)">审核通过</a> <a id="butongguo" href="javascript:NotAwards(3,31)">审核不通过</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="blank10">
</div>
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="bground" style="background: url(../images/weike/hege.gif) no-repeat top 90%; height:100px;">
完成
<br />
<br />
</td>
</tr>
</table>
</td>
</tr>
</table>
<div style="height:10px;"></div>
</td>
</tr>
<tr>
<td>
<table width="590" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#eeeeee">
<tr>
<td width="590" valign="top" bgcolor="#FFFFFF">
<table width="590" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="590" height="25" class="linebotxx2">
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="420">
任务已浏览 <span class="textbluec">投稿时间:</span><span class="textred">2011-9-17 17:00:00</span></td>
<td width="140" style="float:right; margin-right:0px; vertical-align:middle">
<a id="tongguo" href="javascript:Awards(3,35)">审核通过</a> <a id="butongguo" href="javascript:NotAwards(3,35)">审核不通过</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="blank10">
</div>
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="bground" style="background: url(../images/weike/hege.gif) no-repeat top 90%; height:100px;">
qq
<br />
<br />
</td>
</tr>
</table>
</td>
</tr>
</table>
<div style="height:10px;"></div>
</td>
</tr>
</table>
<script type="text/javascript">
function() {
var bg = $(".bground").css("background");
if (bg = "background: url(../images/weike/daishenhe.gif) no-repeat top 90%; height:100px;") {
$("#tongguo").css({ "display": "block" });
$("#butongguo").css({ "display": "block" });
}
if (bg = "background: url(../images/weike/zhongbiao.gif) no-repeat top 90%; height:100px;") {
$("#tongguo").css({ "display": "block" });
$("#butongguo").css({ "display": "none" });
}
else {
$("#tongguo").css({ "display": "block" });
$("#butongguo").css({ "display": "none" });
}
}
</script>
$(document).ready(function(){
$(".bground").each(function(){
var bg=$(this).css("background");
//...
//你当中的if少了个=号
//为什么要判断background,直接判断backgroundImage省得写那么长。
})
})
$(function(){
$(".bground").each(function() {
var bg = $(this).css("background");
//后面不变..
});
});
<script type="text/javascript">
window.onload = $(".tasklist tr .bground").each(function() {
alert("aa");
})
</script>