使用玉时出现在背景下的Bootstrap模态

时间:2012-07-22 08:02:02

标签: twitter-bootstrap pug

我是node.js和jade的首发,我在使用twitter bootstrap的谷歌应用引擎中获得了一个应用。

问题当我将相同的html转换为jade时,模态的行为并不应该如此,而是背景来自它。我删除了淡化课但无济于事。这是jade中的代码

  #newWordModal.modal.hide
    .modal-header
      button.close(type='button', data-dismiss='modal') x
      h3 Add A Word
    .modal-body
      #create-word
        input#new-word-name(type='text', placeholder='Type in a word name')
        input#new-word-def(type='text', placeholder='Define it....')
    .modal-footer
      a.btn(href='#', data-dismiss='modal') Close
      a#add-word.btn.btn-primary(href='#', data-dismiss='modal') Add Word!

html中的相同内容是

<div class="modal hide fade" id="newWordModal">
  <div class="modal-header">
   <button type="button" class="close" data-dismiss="modal">×</button>
   <h3>Add A Word</h3>
  </div>
  <div class="modal-body">
    <div id="create-word">
    <input type="text" id="new-word-name" placeholder="Type in a word name" />
    <input type="text" id="new-word-def" placeholder="Define it...." />
  </div>
 </div>
 <div class="modal-footer">
   <a href="#" class="btn" data-dismiss="modal">Close</a>
   <a href="#" class="btn btn-primary" data-dismiss="modal" id="add-word">Add Word!</a>
 </div>
</div>

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

我认为你错过了&#39; modal.dialog&#39;和&#39;模态内容&#39; class作为内容包装器,如here

所述

您的代码应该如下所示

#playlistloadmodal.modal.fade
        .modal-dialog
            .modal-content
                .modal-header
                    button.close(type='button', data-dismiss='modal') x
                .modal-body
                    #create-word
                        input#new-word-name(type='text', placeholder='Type in a word name')
                        input#new-word-def(type='text', placeholder='Define it....')
                .modal-footer
                    a.btn(href='#', data-dismiss='modal') Close
                    a#add-word.btn.btn-primary(href='#', data-dismiss='modal') Add Word!