Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Twitter Bootstrap Modal - On hidden any
  2. $('button.close').click(function(){
  3.     var divcible=$(this).parent().parent().find(".modal-body");
  4.     var html = divcible.html()
  5.     divcible.html("")
  6.     divcible.html(html)
  7. })
  8.        
  9. $('#myModal').on('hidden', function () {
  10.   // do something…
  11. })
  12.        
  13. $('.myModal').on('hidden', function () {
  14.    // do something…
  15.  
  16.    // edit for clarity: "that" will now reference the modal that was hidden
  17.    var that = this;          
  18. })
  19.        
  20. $(document).on('hidden', function () {
  21.   // a modal closes, so do what you want :)
  22. })