日期:2014-05-16 浏览次数:20402 次
<script type="text/javascript"> var SwitchPicArr = new Array("../Images/black_minus.jpg","../Images/black_plus.jpg") function setDetailMsgRow(rowID, btn) { var row = document.getElementById(rowID); if (row != null) { if (row.style.display == (document.all ? "block" : "table-row")) { row.style.display = "none"; if (btn != null) { btn.style.backgroundImage = "url(" + SwitchPicArr[1] + ")"; } } else { row.style.display = (document.all ? "block" : "table-row"); if (btn != null) { btn.style.backgroundImage = "url(" + SwitchPicArr[0] + ")"; } } } // if (btn != null) { //// if (btn.value != "Hide Detail") { //// btn.value = "Hide Detail"; //// } //// else { //// btn.value = "Display Detail"; //// } // } } </script> .cshtml 部分: @if (item.MessageDetail == "") { @Html.Raw(" ")} else { <input type=button value="" onclick="setDetailMsgRow('@sTmpRowID',this)" style="background:url(../Images/black_plus.jpg);width:40px;height:40px