Guest User

Untitled

a guest
Jun 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. jQuery(document).ready(function($) {
  2.  
  3. $('#link').click(function(e){
  4. // Get the url of the link
  5. var toLoad = $(this).attr('href');
  6.  
  7. // Do some stuff
  8. $(this).animate({
  9. marginRight: '50px',
  10. marginLeft: '-175px'
  11. }, 300, 'easeOutSine').animate({
  12. marginRight: '-38px',
  13. marginLeft: '-120px'
  14. }, 500, 'easeOutBounce');
  15.  
  16. // Stop doing stuff
  17. // Wait 700ms before loading the url
  18. setTimeout(function(){window.location = toLoad}, 700);
  19.  
  20. // Don't let the link do its natural thing
  21. e.preventDefault
  22. });
  23.  
  24. });
Add Comment
Please, Sign In to add comment