Advertisement
Guest User

Untitled

a guest
Sep 13th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.81 KB | None | 0 0
  1. $(document).ready(function() {
  2.   // event.preventDefault();
  3.   alert('jquery loaded');  
  4.   $(".contact1-form-btn").click(function() {
  5.      alert('submit button clicked');
  6.     $(this).addClass("loading");
  7.     alert('before first setTimeout');
  8.  
  9.  
  10.     setTimeout(function() {
  11.        alert('im within first setTimeout');
  12.       $(this).addClass("hide-loading");
  13.       // For failed icon just replace ".done" with ".failed"
  14.       $(".done").addClass("finish");
  15.     }, 3000);
  16.  
  17.  
  18.     alert('before second setTimeout');
  19.  
  20.  
  21.     setTimeout(function() {
  22.       alert('im in second setTimeout');
  23.       $(this).removeClass("loading");
  24.       $(this).removeClass("hide-loading");
  25.       $(".done").removeClass("finish");
  26.       $(".failed").removeClass("finish");
  27.     }, 5000);
  28.  
  29.  
  30.     alert('after second setTimeout');
  31.   })
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement