2016-07-08 70 views
0

我想在用戶提供錯誤的身份驗證憑據但在彈出jAlert彈出之後並且緊緊按下jAlert的關閉btn後重新導回頁面但我無法這樣做。請幫我完成這個任務。提前致謝!!!如何在jAlert中按下「關閉」按鈕時啓用功能


下面是代碼:

<script> 
$(document).ready(function() { 

     $.jAlert({ 
       'title': 'Authentication Error', 
       'content': 'Invalid Username of Password"!', 
       'theme': 'blue', 
       'btns': { 'text': 'close' } 
       }); 
      }); 
</script> 

回答

0

的jAlert插件提供一個onClose功能時進行模態駁回該閃光。定義你想要的功能中的行爲,例如:

<script> 
    $(document).ready(function() { 
     $.jAlert({ 
      'title': 'Authentication Error', 
      'content': 'Invalid Username or Password!', 
      'theme': 'blue', 
      'btns': { 'text': 'close' }, 
      'onClose': function(alertElem) { 
       // alert("Redirecting..."); 
       window.location = "index.html"; 
      } 
     }); 
    }); 
</script> 

http://flwebsites.biz/jAlert/見jAlert文檔。

+0

非常感謝! – Titan97

相關問題