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

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 1.03 KB  |  hits: 13  |  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. Timed event only executes once
  2. function activateSource(id) {
  3.     $("#confirm-activate-" + id).toggle('slow');
  4.     $(document).on('click', '.confirm-activate', function (e) {
  5.         e.preventDefault();
  6.         $.ajax({
  7.             type: "POST",
  8.             cache: false,
  9.             data: {
  10.                 "source-id": id
  11.             },
  12.             url: "modules/source/activatesource.php",
  13.             success: function (data) {
  14.                 $("#confirmation-response").html(data);
  15.                 dismissAlert();
  16.             }
  17.         })
  18.     });
  19. }
  20.  
  21. function dismissAlert() {
  22.     setTimeout(function () {
  23.         $("#confirmation-response").hide('blind', function () {
  24.             loadSourceContent()
  25.         }, 500);
  26.     }, 2500);
  27. }
  28.        
  29. function dismissAlert() {
  30.     // Show the response
  31.     $("#confirmation-response").show( 'blind', 150 );
  32.  
  33.     // Hide the response with a timeout
  34.     setTimeout(function () {
  35.         $("#confirmation-response").hide('blind', function () {
  36.             loadSourceContent()
  37.         }, 500);
  38.     }, 2500);
  39. }