bootstrap模态隐藏不正常

时间:2013-02-04 07:22:25

标签: jquery ruby twitter-bootstrap haml

.row
  .span12
    .front-heading{:style => "width:80%;margin: auto;border-bottom: 2px dotted grey;"} The most innovative fundraising program since thin, minty cookies.
    .modal#myModal.hide.fade
      .modal-header
        Requesting an installation
        = link_to "X", "#", :class => "close", "data-dismiss" => "modal"

    = form_tag request_installation_path,{:method => :post,:remote => true, :style => "margin-bottom:0;", :class => "form-horizontal"} do
      .modal-body
        #sent_message
        %fieldset
          .control-group
            = label_tag "Name", nil, :class => "control-label"
            .controls
                = text_field_tag "name", nil, :class => "span2"
            .control-group
              = label_tag "Email", nil, :class => "control-label"
              .controls
                = email_field_tag "email", nil, :class => "span2"

        .modal-footer
          = submit_tag "request", :class => "btn btn-success"#, "data-dismiss" => "modal"

    .sticky-banner{:style => "position:relative;"}
      %h3 Coaches and Administrators
      %span{:style => "position:absolute;top: 10px;right: 5px;"}

2 个答案:

答案 0 :(得分:1)

$('#myModal').modal('toggle');

这将隐藏/显示模态窗口。说明在这里:http://twitter.github.com/bootstrap/javascript.html#modals

答案 1 :(得分:0)

如果那不起作用。使用以下内容,这应该可行。

$(".modal").css("visibility", "hidden");

并且还要改变用途

$(".modal").css("visibility", "visible");