Skip to content

Instantly share code, notes, and snippets.

@allusis
Created December 12, 2015 18:20
Show Gist options
  • Save allusis/68c6a9d3a38e7b58c7fe to your computer and use it in GitHub Desktop.
Save allusis/68c6a9d3a38e7b58c7fe to your computer and use it in GitHub Desktop.
Add a highlight to an anchor when it's linked
$(document).ready(function(){
$('a[href*="#"]').click(function(){
$($(this).attr("href")).addClass("highlight").delay(10000).queue(function(next){
$(this).removeClass('highlight');
next();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment