<logic:iterate name="studentDetails" id="student" indexId="index">
<tr>
<td><bean:write name="student" property="name" /></td>
<td><bean:write name="student" property="age" /></td>
<td><bean:write name="student" property="class" /></td>
<td><bean:write name="student" property="mark" /></td>
<td><bean:write name="student" property="result" /></td>
</tr>
</logic:iterate>
我想显示所有学生详细信息,并希望以不同颜色突出显示通过的学生详细信息/将鼠标指针设置为手势,同时鼠标移过结果表中的行。
如何检查学生详细信息是否通过以及如何在表格迭代器中设置突出显示颜色?
最佳答案
添加 onmouseover 或 onmouseout
<tr onmouseover="ChangeColor(this,${student.result})>
还添加脚本
<script type="text/javascript">
function ChangeBackgroundColor(row, result) {
if(result =="pass")
{
row.style.backgroundColor = 00FF33;
$(row).css("cursor","pointer");
}
else
row.style.backgroundColor = #FF0000 ;
}
</script>
关于javascript - 如何在鼠标移过表中的行时将鼠标指针更改为手势并更改行的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30646769/