Created
July 26, 2010 20:36
-
-
Save dcneiner/491188 to your computer and use it in GitHub Desktop.
This file contains 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
a:after { | |
... | |
content: attr(title); /* Default to title */ | |
... | |
}; | |
html.js a:after { | |
... | |
content: attr(data-title); /* Shift to data-title */ | |
... | |
}; |
This file contains 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
jQuery(function ($) { | |
$('html').addClass('js'); // add .js to the html element | |
// Take existing titles and move them to data-title instead | |
$('a').each(function (i,el) { | |
$(this).attr('data-title', this.title) | |
.attr('title', ''); // empty out title | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment