简体   繁体   English

使用Java脚本关闭模式(Metro UI)

[英]Close a Modal with Javascript (Metro UI)

I am trying to create a button which closes the modal, but I can not find the right syntax in javascript which closes the modal, default it brings a close-button but I need an additional button to close the modal. 我试图创建一个关闭模态的按钮,但是我无法在JavaScript中找到关闭模态的正确语法,默认情况下它会带来一个关闭按钮,但是我需要一个附加按钮来关闭模态。

Code goes Like this: 代码如下所示:

<div id="textContent" style="margin: 4px; padding: 8px">
<br>
<table>
<tr>
  <td align=right>
   <label for="" class="form">Puesto de Trabajo:</label>
  </td>
  <td>
    <div class="input-control text">
     <input type="text" name="txtPuesto" id="txtPuesto" value="'+puesto+'">
     <button class="btn-clear" tabindex="-1"></button>
    </div>
  </td>
</tr>
<tr>
 <td align=\'right\'>
  <label for="" class="form">Sucursal:</label>
 </td>
 <td>
  <div class="input-control select">
   <select name="SelSucursal" id="SelSucursal" onchange="Select(this.value);">
    <option value="">-Seleccione-</option>
   </select>
  </div>
 </td>
</tr>
<tr>
 <td align=\'right\'>
  <label for="" class="form">Departament:</label>
 </td>
<td>
 <div class="input-control select" id="deptoss">
  <select name="SelDepto" id="SelDepto">
   <option value="">-Choose-</option>
  </select>
 </div>
</td>
</tr>
<tr>
 <td colspan="2">
  <br>
  <div class="place-right">
   <a class="button primary" id="gd02" onclick=\'javascript:UpdateJobPlace('place')\'>Save Changes </a>
  </div>
 </td>
</tr>
</table>
<br>
</div>

hope you can help me. 希望您能够帮助我。 Thanks 谢谢

data-dismiss="modal"到您的按钮。

This might do the trick for you. 这可能会帮到您。

object.onclick=function() {
    modal.style.display = "none";
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM