2016-07-23 32 views
-2

我是這個領域的新手,並試圖創建一個模態。我發現這種模式:http://drublic.github.io/css-modal/#howto 但無法理解哪些文件包含在我的網頁中。我看到有很多不同的文件(SCSS,CSS和JS)以及其他許多文件。 在編寫標記和開始分配任務之前,我應該包含哪些文件?如何創建模態

+0

爲什麼有downvotes?我不明白這個社區! – Husanoo

+0

由於您沒有提供任何代碼,因此存在降價提示,這意味着問題要麼非常模糊,要麼期待會員爲您編寫代碼,而不是這樣。有一個在這裏閱讀有關創建好問題:http://stackoverflow.com/help/mcve – Toby

+0

我認爲應該留下這些問題中的一些,因爲有很多新手誰不知道如何包含文件和在哪裏,地獄,當我從其他地方竊取代碼時,我仍然有時會掙扎:-) –

回答

0

您可以使用Bootstrap模態。他們是靈活,最低功能要求..

 <button class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">Large modal</button> 

<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> 
    <div class="modal-dialog modal-lg"> 
    <div class="modal-content"> 
     <div class="modal-header"> 
     <button type="button" class="close" data-dismiss="modal" aria-label="Close"> 
      <span aria-hidden="true">&times;</span> 
     </button> 
     <h4 class="modal-title">Modal title</h4> 
     </div> 
     <div class="modal-body"> 
     <p>One fine body&hellip;</p> 
     </div> 
     <div class="modal-footer"> 
     <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> 
     <button type="button" class="btn btn-primary">Save changes</button> 
     </div> 
    </div> 
    </div> 
</div> 

必需的CSS和JS文件在的jsfiddle的外部資源鏈接可

您可以找到Here及以下更多的幫助和信息一個工作的例子。

Fiddle Example