Created
November 27, 2012 09:01
-
-
Save koteq/4153240 to your computer and use it in GitHub Desktop.
Strike out dummy links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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