所以我有一个模式,当单击 UI 图标时会打开,并且由于某种原因,模式不会在 IE 以外的任何浏览器中关闭。有没有更简单的方法来做到这一点?或者我可以添加任何浏览器规范?
这是我的代码:
<!-- Click function for modal -->
$(ui).click(function modal() {
el = document.getElementById("modal");
el.style.visibility = (el.style.visibility == "visible")?"hidden":"visible";
});
<div id="modal" class="modal" draggable="true">
<div>
<h3 style="text-decoration: underline"> Summary Report Table </h3>
<table id="summary">
<tr>
<th> Trans Count </th>
<th> Trans Amt </th>
<th> Match Count </th>
</tr>
<tr>
<td> 300 </td>
<td> $200,000 </td>
<td> 4 </td>
</tr>
</table>
<a href='#' onClick='modal()'>Close</a>
</div>
不知道为什么,但它不会让我缩进或返回我的代码。为可读性差表示歉意。