2014-10-03 130 views
-2

我有一個窗體內部模態的揭示模式,當用戶提交表單我想模式關閉。顯示jquery modal關閉

有人可以幫我解決這個問題嗎?

http://zurb.com/playground/reveal-modal-plugin

我試圖改變「dismissmodalclass」以階級提交按鈕的

$('#modal').reveal({ 
    animation: 'fadeAndPop',     //fade, fadeAndPop, none 
    animationspeed: 300,      //how fast animtions are 
    closeonbackgroundclick: true,    //if you click background will modal close? 
    dismissmodalclass: 'close-reveal-modal' //the class of a button or element that will close an open modal 
}); 
+0

你嘗試過什麼的文檔檢查事件綁定? – user733421 2014-10-03 08:52:34

+0

您使用的是什麼模式?默認的jQuery ui之一? – Jerodev 2014-10-03 08:55:59

+0

$('#myProvince')。submit('reveal','close'); 「myProvince是表單ID」 – 2014-10-03 08:56:26

回答

0

我服用它,因爲這是標記基金會所使用的基礎的顯示

在哪種情況下,我會建議您實際閱讀文檔以瞭解是否可以通過javascript解鎖模型(打開或關閉)

**擊發模式與Java的一個例子 - 曲奇警告**

你的結束標記之前與包括foundation.js:

<script> 
$(function() { 
    var COOKIE_NAME = 'welcome_cookie'; 
    $go = $.cookie(COOKIE_NAME); 
    if ($go == null) { 
     $.cookie(COOKIE_NAME, 'This Cookie is used to remember that you have seen our cookie policy', {path: '/', expires: 6}); 
     $('#myModal').foundation('reveal', 'open'); 
    } 
    else { 
    } 
}); 
</script> 

模態:

<div id="myModal" class="reveal-modal small" data-reveal> 
<h2>This Site Uses Cookies.</h2> 
<p class="lead">Cookie Policy.</p> 
<p>To give you the best experience, this site uses cookies, By continuing to use this website you are giving consent to cookies being used. For information on cookies and how you can disable them visit <a href="">here</a></p> 
<a class="close-reveal-modal">&#215;</a> 

這是一個模式的例子,如果歡迎餅乾不存在但彈出關閉然而,確保你所需要的是

$('#myFormModel').foundation('reveal', 'close'); 

而且從

Zurb Foundations | Docs | Reveal