2012-07-12 28 views
3

這是我index.jade文件如何獲取twitter引導模態工作在節點js表達js?

 
.navbar.navbar-fixed-top 
    .navbar-inner 
     .container 
      .brand #{title} 

    .container 
     .row 
      .hero-unit 
       h1 #{title} 
       p Cricket fantasy game where you can be selector. 
       a.btn(data-toggle="modal", href="#myModal") Launch 


div.modal.hide(id="myModal") 
    .modal-header 
     button(type="button", class="close", data-dismiss="modal") x 
     h3 Modal Header 
    .modal-body 
     p One fine body... 
    .modal-footer 

這是我layout.jade文件

 
!!! 
html 
    head 
     title= title 
     link(rel='stylesheet', href='/libs/bootstrap/css/bootstrap.css') 
     link(rel='stylesheet', href='/libs/bootstrap/css/bootstrap.min.css') 
     link(rel='stylesheet', href='/libs/bootstrap/css/bootstrap-responsive.min.css') 
     link(rel='stylesheet', href='/stylesheets/style.css') 
    body!= body 
script(src="/libs/bootstrap/js/bootstrap.js")

我有工作的其他引導要素,但不能按照下面的說明 - 「你可以激活你的情態動詞只需在控制器元素上設置data-toggle =「modal」,其中data-target =「#foo」或href =「#foo」,這對應於模態元素id,點擊後,它會啓動你的模態。「

我該怎麼做?

+0

假設你有'引導-modal.js'(無論是在全JS或單獨),其應該盡我所能地工作。 – 2012-07-12 16:07:15

+0

我有我的bootstrap.js在/ libs/bootstrap/js – diesel 2012-07-12 16:12:54

+1

但是當你下載bootstrap時,你是否勾選了包含所有js組件的框? – 2012-07-12 17:24:29

回答

1

包括在layout.jade文件的jQuery的lib

0

引導前添加的jQuery:

script(src="https://code.jquery.com/jquery-3.2.1.min.js")