Skip to content

Instantly share code, notes, and snippets.

@aldolat
Last active October 8, 2017 21:31
Show Gist options
  • Save aldolat/10597951 to your computer and use it in GitHub Desktop.
Save aldolat/10597951 to your computer and use it in GitHub Desktop.
Removing title attribute and links shortening
jQuery(document).ready(function(){
// Remove the title attribute from all links with "pis-thumbnail-link" class.
jQuery('a.pis-thumbnail-link').removeAttr("title");
// Shorten all links with "pis-title-link" class to 9 characters if they are longer than 10 characters.
jQuery('a.pis-title-link').each(function(){
var str = jQuery(this).text();
str = str.trim(str);
if (str.length > 10) {
jQuery(this).text(str.substr(0, 9));
jQuery(this).append('…');
}
});
// Change all the HTML arrows into a raquo.
jQuery('.pis-arrow').text('»');
// Change the HTML arrows of titles only into a raquo.
jQuery('.pis-title-link .pis-arrow').text('»');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment