Guest User

Untitled

a guest
Aug 5th, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment