Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function($) {
- $('#link').click(function(e){
- // Get the url of the link
- var toLoad = $(this).attr('href');
- // Do some stuff
- $(this).animate({
- marginRight: '50px',
- marginLeft: '-175px'
- }, 300, 'easeOutSine').animate({
- marginRight: '-38px',
- marginLeft: '-120px'
- }, 500, 'easeOutBounce');
- // Stop doing stuff
- // Wait 700ms before loading the url
- setTimeout(function(){window.location = toLoad}, 700);
- // Don't let the link do its natural thing
- e.preventDefault
- });
- });
Add Comment
Please, Sign In to add comment