Skip to content

Instantly share code, notes, and snippets.

@koteq
Created November 27, 2012 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koteq/4153240 to your computer and use it in GitHub Desktop.
Save koteq/4153240 to your computer and use it in GitHub Desktop.
Strike out dummy links
$(window).load(function(){
var live_selectors = [];
$($._data(document, 'events').click).each(function(){
live_selectors.push(this.selector);
});
$('a[href=""], a[href^="#"]').each(function(){
var link = this;
if (this.onclick === null &&
typeof $._data(link, 'events') === 'undefined')
{
var bad_link = true;
$(live_selectors).each(function(id, selector){
if ($(link).is(selector)) {
bad_link = false;
return false;
}
});
if (bad_link) {
$(link).css('text-decoration', 'line-through');
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment