【问题标题】:Open a form on click a button and dissable the background单击按钮打开表单并禁用背景
【发布时间】:2014-05-12 20:17:11
【问题描述】:

我知道这是一个愚蠢的问题,但我不知道从哪里开始开发它。 我有一个表格,可以从用户那里获取详细信息。我希望当我单击一个按钮时,一个 div 会出现在中心和背景上,使用 jquery、javascript、悬停来禁用和模糊

【问题讨论】:

标签: javascript jquery html css hover


【解决方案1】:

我相信您正在寻找模态(Popover)。

这是其中的Example。使用Bootstrap

<a data-target="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>

<div class="modal fade hide" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-remote="/mmfansler/aQ3Ge/show/">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Modal header</h3>
  </div>
  <div class="modal-body">
    <p>One fine body…</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <button class="btn btn-primary">Save changes</button>
  </div>
</div>

如果你不想使用Bootstrap这里是Another Example

【讨论】:

    【解决方案2】:

    试试这个..设计两个 div..

    标记:

    <div class="DivPopup"> 
        //Add controls as you wish
     </div>
    <div class="DivCover" ></div>
    

    CSS:

    .DivAlert
    {
        z-index:22;
        //You can add css styles as you wish
    }
    .DivCover
    {
        opacity:0.4;
        top:0;
        left:0;
        width:100%;
        height:100%;
        z-index:21;
        background-color:White;
        position:absolute;
    }
    

    Javascript:

     $(".DivCover").show();
     $(".DivAlert").show();
    

    不要将此作为您问题的最终答案。只是一个指导。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-16
      • 2023-03-15
      • 1970-01-01
      • 2014-04-07
      • 2011-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多